Bug 191135 - /etc/profile pathmunging should add sbin dirs to non-root PATH
/etc/profile pathmunging should add sbin dirs to non-root PATH
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: setup (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Phil Knirsch
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-08 23:08 EDT by Chris Tyler
Modified: 2015-03-04 20:16 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-03-09 04:16:00 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Chris Tyler 2006-05-08 23:08:45 EDT
Description of problem:
The pathmunging in /etc/profile to add "/sbin:/usr/sbin:/usr/local/sbin" is
conditional on the effective user ID being root (0).

Many system administrators change this file to make the addition of the sbin
directories unconditional. Changing the default would reduce the temptation to
work as root when it is not strictly necessary and it make a plain 'su' much
more useful. The performance hit for searching the additional directories is
almost undetectable and no significant security issues would be introduced.




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


Steps to Reproduce:
1. Start bash as a normal user.
2. Try to execute ifconfig, lsusb, lsof, runlevel, hwclock (and others) - all
commands that provide useful features when run without privilege.
  
Actual results:
- 'command not found'

Expected results:
- Commands should execute.


Additional info:

Because of consolehelper, the sbin directories should be placed at the end of
the path for the non-superuser, and should probably be placed at the start for
the superuser:

# Path manipulation
if [ $EUID = 0 ]; then
        pathmunge /sbin
        pathmunge /usr/sbin
        pathmunge /usr/local/sbin
else
        pathmunge /sbin after
        pathmunge /usr/sbin after
        pathmunge /usr/local/sbin after	
fi
Comment 1 Florian La Roche 2007-03-09 04:16:00 EST
Default should stay as we are right now, the above should rather go into
local config changes.

regards,

Florian La Roche

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