Bugzilla – Bug 515
Sudoedit behaviour changed between sudo 1.7.4_p5 and 1.8.2
Last modified: 2011-10-22 19:39:10 MDT
When I had my sudo upgraded from 1.7.4_p5 to 1.8.2 sudoedit started to change LOGNAME, USERNAME and USER environment variables to those of target user. Sudo manual says resetting these variables when sudo is invoked is the expected default behaviour while sudoedit is expected to run with environment unmodified. Both 1.8.1_p2 and 1.8.2 change the variables above while 1.7.4_p5 works as described in the sudo manual. This is an inconvenience because editors such as emacs use these vars to find the config files.
The problem is that set_logname was having an effect in edit mode.
Created attachment 317 [details] Patch to preserve LOGNAME, USER and USERNAME in sudoedit The problem is that "set_logname" is now the default and there was a missing check for edit mode when updating LOGNAME, etc. The attached patch fixes this and will be in sudo 1.8.3.
Sudo 1.8.3 is out now which has this fixed.