Bug 182740 - "sudo -i" doesn't set $PATH correctly compared to "sudo su -"
Summary: "sudo -i" doesn't set $PATH correctly compared to "sudo su -"
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-02-24 13:23 UTC by Jarkko
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version: sudo-1.6.8p12-4.1
Clone Of:
Environment:
Last Closed: 2007-01-22 13:28:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jarkko 2006-02-24 13:23:37 UTC
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 10:44:29 UTC
Could you send some steps to reproduce this problem.

Comment 2 Jarkko 2006-08-08 15:50:01 UTC
$ 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 11:12:32 UTC
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 11:34:58 UTC
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 13:28:35 UTC
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.