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.
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.