This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amoss
Recipients amoss, steven.daprano, xtreak
Date 2018-09-27.21:08:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1538082515.09.0.545547206417.issue34709@psf.upfronthosting.co.za>
In-reply-to
Content
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.

This also fits my interpretation of the function's documentation: 'Return the "login name" of the user.'

For instance, in a system I use I have to sudo to a system user other than root in order to execute certain scripts and this patch would reveal the original user who executed the sudo command.

I updated the test case already in the existing PR.

I update to the documentation to list SUDO_USER.
History
Date User Action Args
2018-09-27 21:08:35amosssetrecipients: + amoss, steven.daprano, xtreak
2018-09-27 21:08:35amosssetmessageid: <1538082515.09.0.545547206417.issue34709@psf.upfronthosting.co.za>
2018-09-27 21:08:35amosslinkissue34709 messages
2018-09-27 21:08:35amosscreate