From 3b52909fc2b1f0dc8a0c9e0c32612229433aa662 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 16 Sep 2016 14:35:21 -0700 Subject: [PATCH] Don't change ownership of PID_FOLDER Update the launch script so that it no longer changes ownership of the PID_FOLDER. Commit b24e736cfed77be5902f30b79548f051e91d56c9 had changed the chown line from: chown "$run_user" "$PID_FOLDER/${identity}" to: chown "$run_user" "$PID_FOLDER" This meant that it was possible for the launch script to change ownership of `/var/run` and prevent later processes from writing to the folder. Since PID_FOLDER is created before the chown statement, and that the `checkPermissions` function runs to ensure that the PID file can be written, it appears that the chown is not even required. Fixes gh-6532 --- .../org/springframework/boot/loader/tools/launch.script | 1 - 1 file changed, 1 deletion(-) 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 8e2ce5d74c..db3fa0087d 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 @@ -143,7 +143,6 @@ do_start() { mkdir "$PID_FOLDER" &> /dev/null if [[ -n "$run_user" ]]; then checkPermissions || return $? - chown "$run_user" "$PID_FOLDER" chown "$run_user" "$pid_file" chown "$run_user" "$log_file" if [ $USE_START_STOP_DAEMON = true ] && type start-stop-daemon > /dev/null 2>&1; then