Bugzilla – Bug 135
$HOME changes when it shouldn't
Last modified: 2004-05-12 18:39:27 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.
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.