From 3afd0c7b3bafbcbd34878c54d5314d92859442f3 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 14 Jan 2016 10:26:01 +0000 Subject: [PATCH] Address Shellcheck warning (SC2086) for $arguments in launch script MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $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 --- .../org/springframework/boot/loader/tools/launch.script | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script b/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script index 0e80f4eac8..ff5af74c62 100755 --- a/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script +++ b/spring-boot-tools/spring-boot-loader-tools/src/main/resources/org/springframework/boot/loader/tools/launch.script @@ -147,7 +147,7 @@ do_start() { chown "$run_user" "$pid_file" chown "$run_user" "$log_file" 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 \ --chuid "$run_user" \ --name "$identity" \ @@ -155,7 +155,7 @@ do_start() { --background --no-close \ --startas "$javaexe" \ --chdir "$working_dir" \ - -- $arguments \ + -- "${arguments[@]}" \ >> "$log_file" 2>&1 await_file "$pid_file" else