Bug 109

Summary: "sudo su -p" does not preserve the environment
Product: Sudo Reporter: Greg Steele <greg.steele>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED INVALID    
Severity: high    
Priority: high    
Version: 1.6.7   
Hardware: All   
OS: Linux   

Description Greg Steele 2003-04-29 13:40:07 MDT
According to the documentation for su, the "-p" option should preserve the 
environment variables `HOME', `USER', `LOGNAME',or `SHELL'. When executed from 
the login shell, these variables are preserved. When executed using 
sudo, 'HOME' is preserved, but 'USER' and 'LOGNAME' are set to 'root'.
Comment 1 Todd C. Miller 2004-01-17 20:38:43 MST
Sudo sets USER and LOGNAME to the target user.  If you don't want this, you can 
use a line like this in sudoers:

Defaults    !set_logname