Bug 191135 - /etc/profile pathmunging should add sbin dirs to non-root PATH
Summary: /etc/profile pathmunging should add sbin dirs to non-root PATH
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: setup
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Knirsch
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-09 03:08 UTC by Chris Tyler
Modified: 2015-03-05 01:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-03-09 09:16:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Chris Tyler 2006-05-09 03:08:45 UTC
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 09:16:00 UTC
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.