Bug 515

Summary: Sudoedit behaviour changed between sudo 1.7.4_p5 and 1.8.2
Product: Sudo Reporter: punloh
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: low    
Version: 1.8.2   
Hardware: PC   
OS: Linux   
Attachments: Patch to preserve LOGNAME, USER and USERNAME in sudoedit

Description punloh 2011-10-08 14:08:26 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.
Comment 1 Todd C. Miller 2011-10-10 13:11:00 MDT
The problem is that set_logname was having an effect in edit mode.
Comment 2 Todd C. Miller 2011-10-10 13:12:45 MDT
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.
Comment 3 Todd C. Miller 2011-10-22 19:39:10 MDT
Sudo 1.8.3 is out now which has this fixed.