Bugzilla – Bug 282
sudo resets HOME envar
Last modified: 2008-04-24 11:22:18 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).
You are correct; I've fixed this in the sudo cvs tree.