Bugzilla – Bug 440
changes in 1.7.4 make sudo -H not usable
Last modified: 2011-03-03 09:53:39 MST
the play that was started with 1.7.4 makes sudo unusable for me, i can no longer have two kind of shells, one where $HOME is preserved and other where $HOME is reset for target user. seems -H is not functioning at all. see also this mailing list post for problem report: http://lists.pld-linux.org/mailman/pipermail/pld-devel-en/2010-August/021777.html probably i could "detect" the situation on $SUDO_USER variable, and act on it, it wouldnt be so horrible, if it was just $HOME, but all kinds of user shell vars init depend on $HOME var, meaning these all needs to be overridden: with: Defaults env_keep += HOME glen$ sudo -H -u builder bash -l builder$ env | grep glen TMPDIR=/home/glen/tmp SUDO_USER=glen SCREENDIR=/home/glen/.screen PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin:/home/glen/bin:/usr/games PWD=/home/glen HOME=/home/glen TMP=/home/glen/tmp HISTFILE=/home/glen/.history
Created attachment 293 [details] Interoperability fix for HOME in env_keep and -H flag
I've attached a patch that is currently scheduled for sudo 1.7.5 that should address this.
that's a quick one! i'll test it right away! :)
great, seems work again! with "Defaults env_keep += HOME" : $ sudo env | grep HOME HOME=/home/glen $ sudo -H env | grep HOME HOME=/root $ sudo -i -H env | grep HOME JAVA_HOME=/usr/lib/jvm/java HOME=/root $ sudo -V Sudo version 1.7.4p4 (with the patch from this bug)
Fixed in sudo 1.7.5 and 1.8.0.