sudo resets HOME envar
Bug #221395 reported by
Tushar T
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sudo (Ubuntu) |
Fix Released
|
Undecided
|
Martin Pitt | ||
Hardy |
Fix Released
|
Undecided
|
Martin Pitt |
Bug Description
Binary package hint: sudo
See the upstream bug that I had reported and was fixed:
http://
As root, when I execute the command:
HOME=<some_dir> sudo -u <some_user>
HOME is set to /root (root's home dir) not <some_dir>. As per the documentation, sudo should not mess with the HOME envar unless -H or -i is specified.
This is on hardy. It worked on gutsy.
TEST CASE:
broken Hardy final version:
$ HOME=/tmp sudo -u nobody sh -c 'echo $HOME'
/home/martin
with hardy-proposed fixed version:
$ HOME=/tmp sudo -u nobody sh -c 'echo $HOME'
/tmp
http:// www.sudo. ws/cgi- bin/cvsweb/ sudo/env. c.diff? r1=1.39. 2.17&r2= 1.39.2. 18