sudo 1.7.4
Elan Ruusamäe
glen at pld-linux.org
Tue Aug 31 20:21:24 CEST 2010
with sudo 1.7.4 [1], it's impossible to keep $HOME on target user and
force target user $HOME with -H switch.
also the keep_env seem to have no effect for -H at all, i get one
version (HOME always for target user) or the other variant (HOME always
for source user), but no way to have both depending of using -H or not.
1. without keep_env HOME
$ sudo grep HOME /etc/sudoers
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
#Defaults env_keep += HOME
$ sudo env | grep HOME
HOME=/root
$ sudo -H env | grep HOME
HOME=/root
$ sudo -i -H env | grep HOME
JAVA_HOME=/usr/lib/jvm/java
HOME=/root
2. with keep_env HOME
$ sudo grep HOME /etc/sudoers
## Run X applications through sudo; HOME is used to find the
## .Xauthority file. Note that other programs use HOME to find
Defaults env_keep += HOME
$ sudo env | grep HOME
HOME=/home/glen
$ sudo -H env | grep HOME
HOME=/home/glen
$ sudo -i -H env | grep HOME
JAVA_HOME=/usr/lib/jvm/java
HOME=/home/glen
changes in code are removing initial keepenv,
plus some other changes regarding playing with $HOME and $MAIL:
--- sudo-1.7.3/env.c 2010-08-31 17:42:24.442574712 +0300
+++ sudo-1.7.4/env.c 2010-08-02 13:21:19.101368650 +0300
@@ -191,11 +196,9 @@
static const char *initial_keepenv_table[] = {
"COLORS",
"DISPLAY",
- "HOME",
"HOSTNAME",
"KRB5CCNAME",
"LS_COLORS",
- "MAIL",
"PATH",
"PS1",
"PS2",
--
glen
More information about the pld-devel-en
mailing list