From d4201b718f63645f6688b5f0c9a8045bcc885e3d Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 20 Oct 2017 11:17:02 +1100 Subject: [PATCH 1/2] Fix #1763 --- jetty-distribution/src/main/resources/bin/jetty.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/jetty-distribution/src/main/resources/bin/jetty.sh b/jetty-distribution/src/main/resources/bin/jetty.sh index 2f6ba41776f..8966cffaddb 100755 --- a/jetty-distribution/src/main/resources/bin/jetty.sh +++ b/jetty-distribution/src/main/resources/bin/jetty.sh @@ -468,6 +468,7 @@ case "$ACTION" in chown "$JETTY_USER" "$JETTY_PID" # FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc. su - "$JETTY_USER" $SU_SHELL -c " + cd "$JETTY_BASE" exec ${RUN_CMD[*]} start-log-file="$JETTY_LOGS/start.log" > /dev/null & disown \$! echo \$! > '$JETTY_PID'" From 818cad59b70affb016750e81a78561039c470c9d Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Fri, 20 Oct 2017 11:25:27 +1100 Subject: [PATCH 2/2] Fix #1763 --- jetty-distribution/src/main/resources/bin/jetty.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jetty-distribution/src/main/resources/bin/jetty.sh b/jetty-distribution/src/main/resources/bin/jetty.sh index 8966cffaddb..1fc5e87e37e 100755 --- a/jetty-distribution/src/main/resources/bin/jetty.sh +++ b/jetty-distribution/src/main/resources/bin/jetty.sh @@ -468,10 +468,10 @@ case "$ACTION" in chown "$JETTY_USER" "$JETTY_PID" # FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc. su - "$JETTY_USER" $SU_SHELL -c " - cd "$JETTY_BASE" - exec ${RUN_CMD[*]} start-log-file="$JETTY_LOGS/start.log" > /dev/null & + cd \"$JETTY_BASE\" + exec ${RUN_CMD[*]} start-log-file=\"$JETTY_LOGS/start.log\" > /dev/null & disown \$! - echo \$! > '$JETTY_PID'" + echo \$! > \"$JETTY_PID\"" else "${RUN_CMD[@]}" > /dev/null & disown $!