Bug 135

Summary: $HOME changes when it shouldn't
Product: Sudo Reporter: Todd Heer <theer>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: normal    
Priority: normal    
Version: 1.6.7   
Hardware: PC   
OS: Linux   

Description Todd Heer 2004-04-13 17:58:49 MDT
Seems as though something has changed between v1.6.2 and v1.6.7p5 such that when
a user who has "ALL=(ALL) ALL" in the sodoers file runs 'sudo su' the $HOME
environment variable gets changed, as opposed to 'sudo su -'. 

I have tried compiling the 1.6.7p5 version with and without the
--enable-shell-sets-home configuration option, but the results are the same -
$HOME gets changed to the "target" user (root in this case). Trying the -H and
-s flags has had no effect on the issue. 

It is my understanding that the default nature should be that $HOME remain the
same when running "sudo su", as it does with my v1.6.2 running on AIX.
Comment 1 Todd C. Miller 2004-05-12 14:39:27 MDT
No, this has not changed.  What *has* changed is that sudo now sets the USER and 
LOGNAME environment variables to the target user.  If you don't want that, add a 
line like:

    Defaults   !set_logname

to your sudoers file.