Bug 56

Summary: -H ignored without -s
Product: Sudo Reporter: sudo
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: low    
Priority: normal    
Version: 1.6.3   
Hardware: Other   
OS: Other   

Description sudo 2001-11-08 14:54:15 MST
Feature or bug? The -H switch seems be ignored unless coupled with -s. For example:

[puma:~] foo% sudo -H -u bar echo ~Password:/Users/foo[puma:~] foo% sudo -s -H -u bar[puma:/Users/foo] bar% echo ~/Users/bar

This is on Mac OS X 10.1.
Comment 1 sudo 2001-11-08 14:56:59 MST
That didn't wrap correctly. Maybe this will:

[puma:~] foo% sudo -H -u bar echo ~
Password:
/Users/foo
[puma:~] foo% sudo -s -H -u bar
[puma:/Users/foo] bar% echo ~
/Users/bar
Comment 2 Todd C. Miller 2001-11-08 14:58:59 MST
Nope, the '~' is being expanded by your shell before sudo even runs.  A better test is:
% sudo -H printenv | grep HOME
HOME=/root