diff --git a/jetty-home/src/main/resources/bin/jetty.sh b/jetty-home/src/main/resources/bin/jetty.sh index 0c183e1c029..c128bbad2ce 100755 --- a/jetty-home/src/main/resources/bin/jetty.sh +++ b/jetty-home/src/main/resources/bin/jetty.sh @@ -484,9 +484,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 " - exec ${RUN_CMD[*]} start-log-file="$JETTY_START_LOG" > /dev/null & + cd \"$JETTY_BASE\" + exec ${RUN_CMD[*]} start-log-file=\"$JETTY_START_LOG\" > /dev/null & disown \$! - echo \$! > '$JETTY_PID'" + echo \$! > \"$JETTY_PID\"" else "${RUN_CMD[@]}" > /dev/null & disown $!