Issue a warning from launch script when app will run as root

See gh-10275
pull/14420/head
Oliver B. Fischer 7 years ago committed by Andy Wilkinson
parent 120429427a
commit 94ebd33747

@ -128,6 +128,9 @@ log_file="$LOG_FOLDER/$LOG_FILENAME"
# shellcheck disable=SC2012 # shellcheck disable=SC2012
[[ $(id -u) == "0" ]] && run_user=$(ls -ld "$jarfile" | awk '{print $3}') [[ $(id -u) == "0" ]] && run_user=$(ls -ld "$jarfile" | awk '{print $3}')
# Issue an 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 # Find Java
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
javaexe="$JAVA_HOME/bin/java" javaexe="$JAVA_HOME/bin/java"

Loading…
Cancel
Save