Bug 182740 - "sudo -i" doesn't set $PATH correctly compared to "sudo su -"
"sudo -i" doesn't set $PATH correctly compared to "sudo su -"
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: sudo (Show other bugs)
4
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-24 08:23 EST by Jarkko
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version: sudo-1.6.8p12-4.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-22 08:28:35 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 Jarkko 2006-02-24 08:23:37 EST
Description of problem:

"sudo -i" doesn't set $PATH correctly compared to "sudo su -". (Sorry if this is
not sudo related but something else. For me as a user it is sudo. Please
reassign if i picked a wrong component.)


Version-Release number of selected component (if applicable):

sudo-1.6.8p8-2.4
Comment 1 Peter Vrabec 2006-08-08 06:44:29 EDT
Could you send some steps to reproduce this problem.
Comment 2 Jarkko 2006-08-08 11:50:01 EDT
$ sudo su -
Password:
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

$ sudo -i
# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/jval/bin
Comment 3 Peter Vrabec 2006-08-29 07:12:32 EDT
It seems problem is that "$ sudo -i" doesn't reset PATH variable. I have asked upstream, if it 
is desired behavior, but I haven't received any answer yet.

$ echo $PATH
/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin:/usr/games:/home/peter/bin:/usr/sbin/:/sbin
$ export PATH="$PATH:/foo"
$ sudo -i
Password:
# echo $PATH
/usr/kerberos/sbin:/usr/local/sbin:/usr/sbin:/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin:/usr/games:/home/peter/bin:/usr/sbin/:/sbin:/foo:/root/bin

Comment 4 Christian Iseli 2007-01-22 06:34:58 EST
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.
Comment 5 Jarkko 2007-01-22 08:28:35 EST
The behaviour has changed. I've tested this in FC5.

Now "sudo -i" adds all root user related paths to $PATH.

I assume that's how this command is supposed to work. So closing the bug...

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