Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 587183 - /usr/local/bin missing from root path, */sbin present in user paths
/usr/local/bin missing from root path, */sbin present in user paths
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: setup (Show other bugs)
6.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Ondrej Vasik
qe-baseos-daemons
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-04-29 05:39 EDT by Petter Urkedal
Modified: 2010-04-29 09:44 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-04-29 07:32:35 EDT
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 Petter Urkedal 2010-04-29 05:39:02 EDT
Description of problem:

/usr/local/bin is missing from root's $PATH, /usr/local/sbin, /usr/sbin, and /sbin are present in users' $PATHs.

Version-Release number of selected component (if applicable):
setup-2.8.14-1.el6.noarch

How reproducible: always

Steps to Reproduce:
1. privenv PATH (as user and as root)
  
Actual results:
For root:
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
For user:
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin

Expected results:


Additional info:

The relevant path of /etc/profile is:

----%<----
# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /sbin
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
else
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
    pathmunge /sbin after
fi
----%<----

I think it should be something like:

----%<----
# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /sbin
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
fi
pathmunge /usr/local/bin after
pathmunge /usr/bin after
pathmunge /bin after
----%<----
Comment 2 Ondrej Vasik 2010-04-29 07:32:26 EDT
Thanks for report. 

Actually, sbin directories should be available to normal non-root users in RHEL-6 - see https://fedoraproject.org/wiki/Features/SbinSanity and related bzilla https://bugzilla.redhat.com/show_bug.cgi?id=458176 for details. So that part of the bugzilla report is notabug and expected behaviour.

Second one - /usr/local/bin is missing is based on the "init path" - on the way you are starting the shell. See http://www.faqs.org/docs/Linux-mini/Path.html for some details.

Closing NOTABUG (as this is not a bug in setup package), if you think /usr/local/bin should be set in "init path" for root in some specific situation where is not set at the moment, feel free to report it against particular component responsible for the "init path" - bash? in your case (see `strings /bin/bash | grep /usr/local/bin`) ...
Comment 3 Petter Urkedal 2010-04-29 09:44:26 EDT
Thanks for the quick reply.  I wasn't aware of the new policy, and the second issue is indeed dependent on the init path (sudo -i).

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