fix sudo execution (patch by robertmx in #223)

tested also in #228, this stops overwriting the $USERNAME
variable which is not really useful (it was used in the previous
privilege escalation model)
This commit is contained in:
Jaromil 2016-11-18 19:00:47 +01:00
parent 7e88c5d07b
commit 844a886da1

8
tomb
View File

@ -210,10 +210,10 @@ _whoami() {
_verbose "Identified caller: ::1 username:: (::2 UID:::::3 GID::)" $_USER $_UID $_GID _verbose "Identified caller: ::1 username:: (::2 UID:::::3 GID::)" $_USER $_UID $_GID
# Update USERNAME accordingly if possible # Update USERNAME accordingly if possible
[[ $EUID == 0 && $_USER != $USERNAME ]] && { # [[ $EUID == 0 && $_USER != $USERNAME ]] && {
_verbose "Updating USERNAME from '::1 USERNAME::' to '::2 _USER::')" $USERNAME $_USER # _verbose "Updating USERNAME from '::1 USERNAME::' to '::2 _USER::')" $USERNAME $_USER
USERNAME=$_USER # USERNAME=$_USER
} # }
# Force HOME to _USER's HOME if necessary # Force HOME to _USER's HOME if necessary
local home=$(awk -F: "/^$_USER:/ { print \$6 }" /etc/passwd 2>/dev/null) local home=$(awk -F: "/^$_USER:/ { print \$6 }" /etc/passwd 2>/dev/null)