mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge pull request #10275 from Oliver B. Fischer
* gh-10275: Polish "Issue a warning from launch script when app will run as root" Issue a warning from launch script when app will run as root
This commit is contained in:
commit
0fe60109b1
@ -128,6 +128,9 @@ log_file="$LOG_FOLDER/$LOG_FILENAME"
|
||||
# shellcheck disable=SC2012
|
||||
[[ $(id -u) == "0" ]] && run_user=$(ls -ld "$jarfile" | awk '{print $3}')
|
||||
|
||||
# Issue a warning if the application will run as root
|
||||
[[ $(id -u ${run_user}) == "0" ]] && { echoYellow "Application is running as root (UID 0). This is considered insecure."; }
|
||||
|
||||
# Find Java
|
||||
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
|
||||
javaexe="$JAVA_HOME/bin/java"
|
||||
|
Loading…
Reference in New Issue
Block a user