Bug 463 - -H ignored in combination with -s
-H ignored in combination with -s
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.7.4
PC Other
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-31 18:03 MST by kbyanc
Modified: 2011-03-03 09:52 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kbyanc 2011-01-31 18:03:10 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.
Comment 1 kbyanc 2011-01-31 19:40:17 MST
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.
Comment 2 Todd C. Miller 2011-02-01 15:31:03 MST
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
Comment 3 Todd C. Miller 2011-03-03 09:52:06 MST
Fixed in sudo 1.7.5 and 1.8.0.