Bug 479078 - printenv has different output between sudo versions
printenv has different output between sudo versions
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: sudo (Show other bugs)
5.3
All Linux
low Severity low
: rc
: ---
Assigned To: Daniel Kopeček
BaseOS QE
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-06 16:57 EST by Martin Kočí
Modified: 2009-01-12 04:06 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-12 04:06:09 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Martin Kočí 2009-01-06 16:57:17 EST
Description of problem:
sudo printenv command returns different output in old and new version of sudo. 

Version-Release number of selected component (if applicable):
new:
===
# rpm -q sudo
sudo-1.6.9p17-3.el5.i386
old: 
===
# rpm -q sudo
sudo-1.6.8p12-12.el5.i386

How reproducible:
Always

Steps to Reproduce:
1. eg. #sudo printenv PATH

  
Actual results:
/usr/bin:/bin

Expected results:
content of $PATH variable such as /usr/lib/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

Additional info:
I old version I get content of $PATH variable, but in new version I get "Actual results" above. I don't know if it's feature or bug.
Comment 1 Martin Kočí 2009-01-06 18:27:25 EST
Seems it is a feature. In the /etc/sudoers exists two options : env_reset and env_keep. 
Defaults   env_reset
Defaults   env_keep = "COLORS DISPLAY EDITOR HOSTNAME HISTSIZE INPUTRC KDEDIR \
                       LESSOPEN LS_COLORS MAIL PS1 PS2 QTDIR SSH_ASKPASS 
                        USERNAME \
                        LANG LC_ADDRESS LC_CTYPE LC_COLLATE LC_IDENTIFICATION \
                        LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC
                        LC_PAPER LC_TELEPHONE LC_TIME LC_ALL LANGUAGE LINGUAS \
                        _XKB_CHARSET"

While PATH is not mentioned in env_keep then PATH is reset and gets default path /usr/bin:/bin. So for proper behaviour I need place PATH word into env_keep. In the old version were default setup TERM and PATH as preserve environment value. In the new version this were removed so you need setup it manually.

Note You need to log in before you can comment on or make changes to this bug.