Bug 282 - sudo resets HOME envar
sudo resets HOME envar
Status: VERIFIED FIXED
Product: Sudo
Classification: Unclassified
Component: Sudo
1.6.9
PC Linux
: normal normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-03-09 23:58 MDT by Tushar Teredesai
Modified: 2008-04-24 11:22 MDT (History)
0 users

See Also:


Attachments
add HOME to initial_keepenv_table to preserve HOME (262 bytes, patch)
2008-03-09 23:58 MDT, Tushar Teredesai
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tushar Teredesai 2008-03-09 23:58:39 MDT
Created attachment 223 [details]
add HOME to initial_keepenv_table to preserve HOME

sudo is configured with the following options: "--disable-root-mailer --enable-noargs-shell --without-mail-if-no-user --disable-pam-session --without-lecture --without-sendmail --with-logging=file --without-pam". The sudoers file is the default that is installed by the package. 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.

To fix it, I added HOME to the initial_keepenv_table (patch attached).
Comment 1 Todd C. Miller 2008-03-13 07:35:37 MDT
You are correct; I've fixed this in the sudo cvs tree.