Bug 143824

Summary: root path after su should have sbin directories
Product: [Fedora] Fedora Reporter: Christopher Beland <beland>
Component: rootfilesAssignee: Bill Nottingham <notting>
Status: CLOSED DUPLICATE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: mattdm, mfabry, roadtripdk, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-23 17:46:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christopher Beland 2004-12-29 06:26:24 UTC
After freshly installing Fedora Core 3, I logged in as beland and su'd
to root and typed "service network restart".  This failed because
"service" was not in my path.

When both root and beland use /bin/bash as shells, I get the following
results...

Path when I log in as beland:
 /usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
Path when I su to root from beland:
 /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin
Path when I log in as root:
 /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin

Using /bin/tcsh, the only difference is when I log in as root:
 /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin

The upshot of this bug is that /usr/local/sbin, /sbin, and /usr/sbin
should appear in root's path after an su, and they don't (for both
bash and tcsh).

I'm not sure why /root/bin should be in there at all, considering that
it doesn't exist after a fresh install.

Beland

Comment 1 Bill Nottingham 2004-12-30 00:54:25 UTC
Use 'su -' to start a login shell as root.

Comment 2 Ignacio Vazquez-Abrams 2006-03-30 14:16:16 UTC
*** Bug 187359 has been marked as a duplicate of this bug. ***

Comment 3 Christopher Beland 2006-03-30 19:06:39 UTC
"su -" changes the current working directory to /root, which is somewhat
inconvenient when you're in the middle of something, so I don't do that.  Around
the office, everyone I've seen change to root uses "su" instead of "su -", and
has hit the /sbin problem when I tell them how to stop and start services. 
Apparently the person who reported 187359 has also tripped over this problem. 
Is there anything else that "su -" does that makes a difference?  It seems like
an easy fix to patch the path, to make the interface a little more user-friendly.

Comment 4 Matthew Miller 2006-07-10 22:46:04 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!


Comment 5 Christopher Beland 2008-01-23 21:57:45 UTC
This is still an issue in Fedora 8.

Comment 6 Christopher Beland 2008-09-23 14:49:51 UTC
According to:

http://fedoraproject.org/wiki/Features/SbinSanity

this will be fixed in Fedora 10.  It's not fixed in Fedora 10 Alpha, but perhaps it will be in the beta release.

Comment 7 Bill Nottingham 2008-09-23 17:46:11 UTC

*** This bug has been marked as a duplicate of bug 458176 ***