Bugzilla – Bug 463
-H ignored in combination with -s
Last modified: 2011-03-03 09:52:06 MST
-s starts sudo in "shell" mode rather than "run" mode; -H appears to only be honored in "run" mode. As a result, the command sudo -Hs does not reset $HOME. Note that sudo -Hs did reset home (as documented in the man page) in sudo 1.7.2.
It it helps, I should mention that my /etc/sudoers has "Defaults env_reset" and "Defaults env_keep += "HOME" in it. I still expected that -H would override these defaults, though.
This is fixed in sudo 1.7.5 which is currently in beta test: $ grep HOME /etc/sudoers Defaults env_keep +="HOME" $ sudo-1.7.5 -s # echo $HOME /home/millert # exit $ sudo-1.7.5 -sH # echo $HOME /root # exit
Fixed in sudo 1.7.5 and 1.8.0.