Commit 3afd0c7b authored by Andy Wilkinson's avatar Andy Wilkinson

Address Shellcheck warning (SC2086) for $arguments in launch script

$arguments needs to be split on spaces so it can’t just be wrapped
in quotes. This commit updates arguments to be an array that is then
expanded ("{arguments[@]}"). The use of @ and double quotes means that
it is expanded into all elements individually quoted.

See gh-4866
parent 27a81e14
...@@ -147,7 +147,7 @@ do_start() { ...@@ -147,7 +147,7 @@ do_start() {
chown "$run_user" "$pid_file" chown "$run_user" "$pid_file"
chown "$run_user" "$log_file" chown "$run_user" "$log_file"
if [ "${useStartStopDaemon:-true}" = true ] && type start-stop-daemon > /dev/null 2>&1; then if [ "${useStartStopDaemon:-true}" = true ] && type start-stop-daemon > /dev/null 2>&1; then
arguments="-Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS -jar $jarfile $RUN_ARGS $*" arguments=(-Dsun.misc.URLClassPath.disableJarChecking=true $JAVA_OPTS -jar $jarfile $RUN_ARGS "$@")
start-stop-daemon --start --quiet \ start-stop-daemon --start --quiet \
--chuid "$run_user" \ --chuid "$run_user" \
--name "$identity" \ --name "$identity" \
...@@ -155,7 +155,7 @@ do_start() { ...@@ -155,7 +155,7 @@ do_start() {
--background --no-close \ --background --no-close \
--startas "$javaexe" \ --startas "$javaexe" \
--chdir "$working_dir" \ --chdir "$working_dir" \
-- $arguments \ -- "${arguments[@]}" \
>> "$log_file" 2>&1 >> "$log_file" 2>&1
await_file "$pid_file" await_file "$pid_file"
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment