Bug 479078 - printenv has different output between sudo versions
Summary: printenv has different output between sudo versions
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: sudo
Version: 5.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Daniel Kopeček
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-06 21:57 UTC by Martin Kočí
Modified: 2009-01-12 09:06 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-12 09:06:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Kočí 2009-01-06 21:57:17 UTC
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 23:27:25 UTC
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.