From 2cae586c346059b8de3c097755b6ef605eecffc2 Mon Sep 17 00:00:00 2001 From: Filippo Squillace Date: Wed, 24 Jun 2015 18:33:02 +0000 Subject: [PATCH] Use SUDO_USER instead of SUDO_UID --- lib/core.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/core.sh b/lib/core.sh index 06ac5fa..dacc020 100644 --- a/lib/core.sh +++ b/lib/core.sh @@ -192,7 +192,8 @@ function setup_env_from_file(){ function run_env_as_root(){ local uid=$UID - [ -z $SUDO_UID ] || uid=$SUDO_UID:$SUDO_GID + # SUDO_USER is more reliable compared to SUDO_UID + [ -z $SUDO_USER ] || uid=$SUDO_USER:$SUDO_GID local main_cmd="${SH[@]}" [ "$1" != "" ] && main_cmd="$(insert_quotes_on_spaces "$@")"