Bug 56 - -H ignored without -s
-H ignored without -s
Status: RESOLVED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.3
Other Other
: normal low
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-08 14:54 MST by sudo
Modified: 2001-11-08 18:58 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 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