Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 156404 - /env/profile should also include previous PATH for root
Summary: /env/profile should also include previous PATH for root
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-27 05:36 UTC by Gregory Bleiker
Modified: 2006-11-27 07:05 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Bleiker 2006-11-27 05:36:37 UTC
The following is out of /env/profile

if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
else
        PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
fi

I think that in the "root" case, any previous PATH should be included as well, so the code would look like:

if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
        PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}:${PATH}"
else
        PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
fi

If this is not done, then any newly set PATH entries in /etc/env.d/* will not affect root. Maybe this is by design?
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-11-27 07:05:41 UTC
Yes, this is by design for security reasons...