[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2018-09-27 Thread Amos S
Amos S added the comment: The use of environment variables like USER and LOGNAME instead of getuid() etc is done in order to try to get "who really initiated this process?" rather than "who this process belongs to?". This is hidden today when SUDO_USER is ignored

[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2018-09-22 Thread Amos S
Change by Amos S : -- keywords: +patch pull_requests: +8903 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34709> ___ ___ Python-

[issue34709] Suggestion: make getuser.getpass() also look at SUDO_USER environment variable

2018-09-16 Thread Amos S
New submission from Amos S : When doing "sudo python-script.py", the output of "getpass.getuser()" is pretty much useless for what it's used (I assume mainly logging and tracking purposes, that's what we use it for ourselves). I worked around this limitation by using it