mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Only check for SUDO_USER when looking for sudo
This commit is contained in:
parent
a9baeb26d2
commit
ed4e9bf708
@ -105,7 +105,7 @@ class LocalClient(object):
|
||||
# if our user is root, look for other ways to figure out
|
||||
# who we are
|
||||
if user == 'root' or 'SUDO_USER' in os.environ:
|
||||
env_vars = ['SUDO_USER', 'USER', 'USERNAME']
|
||||
env_vars = ['SUDO_USER']
|
||||
for evar in env_vars:
|
||||
if evar in os.environ:
|
||||
return 'sudo_{0}'.format(os.environ[evar])
|
||||
|
Loading…
Reference in New Issue
Block a user