[sudo-users] Question about environment variable preservation

Ted Carr ted.carr at sungardas.com
Fri Sep 16 10:02:05 MDT 2016


Hello!

I have compiled 1.8.17p1 on Solaris 10 and I am seeing an odd issue, when I
run 'sudo -i' for some reason PS1 remains set as I had it for my login.  In
other words PS1 is not being reset to '# ' as I would have expected.   In
my sudoers file I have:

Defaults   env_reset
Defaults   env_delete = "PS1"

sudo -V shows:

Reset the environment to a default set of variables
Environment variables to check for sanity:
        TERM
        LINGUAS
        LC_*
        LANGUAGE
        LANG
        COLORTERM
Environment variables to remove:
        PS1
Environment variables to preserve:
        XAUTHORIZATION
        XAUTHORITY
        TZ
        PS2
        PS1
        PATH
        LS_COLORS
        KRB5CCNAME
        HOSTNAME
        DISPLAY
        COLORS

Configure Options:

# sudo -V
Sudo version 1.8.17p1
Configure options: --prefix=/opt/sudo/1.8.17p1 --with-ldap --with-project
--with-rundir=/var/run/sudo --with-pam --with-pam-login
--disable-pam-session --with-tty-tickets --with-insults --with-all-insults
--without-lecture --with-ignore-dot --with-solaris-audit
sudo_cv_var_nroff_opt_Tascii=no

Appreciate any help.

Cheers,
Ted


More information about the sudo-users mailing list