diff options
author | William Hubbs <williamh@gentoo.org> | 2018-05-26 13:36:31 -0500 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2018-05-26 14:35:11 -0500 |
commit | 277e5b9e55717873b87eb541a95f4f2ae0c60a4d (patch) | |
tree | d3208bbf78bcf5b3191522c2b3673e28d869bb92 /etc | |
parent | Update ChangeLog (diff) | |
download | baselayout-277e5b9e55717873b87eb541a95f4f2ae0c60a4d.tar.gz baselayout-277e5b9e55717873b87eb541a95f4f2ae0c60a4d.tar.bz2 baselayout-277e5b9e55717873b87eb541a95f4f2ae0c60a4d.zip |
Add sbin directories to path
This is a partial revert of 9cac4dd130637fa2c1f1a64bf3c9d2509284e6dd.
We need to have path and rootpath be the same, to allow transitioning
packages before we drop rootpath.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/env.d/50baselayout | 1 | ||||
-rw-r--r-- | etc/profile | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/etc/env.d/50baselayout b/etc/env.d/50baselayout index b10a2c4d..694a2336 100644 --- a/etc/env.d/50baselayout +++ b/etc/env.d/50baselayout @@ -2,6 +2,7 @@ # Do not edit this file PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin" +ROOTPATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin" MANPATH="/usr/local/share/man:/usr/share/man" INFOPATH="/usr/share/info" CONFIG_PROTECT_MASK="/etc/gentoo-release" diff --git a/etc/profile b/etc/profile index 4579bd17..8e92e824 100644 --- a/etc/profile +++ b/etc/profile @@ -18,6 +18,16 @@ export PAGER=${PAGER:-/usr/bin/less} # 077 would be more secure, but 022 is generally quite realistic umask 022 +# Set up PATH depending on whether we're root or a normal user. +# There's no real reason to exclude sbin paths from the normal user, +# but it can make tab-completion easier when they aren't in the +# user's PATH to pollute the executable namespace. +if [ "${EUID-}" = "0" ] || [ "${USER-}" = "root" ] ; then + PATH="${ROOTPATH}" +fi +export PATH +unset ROOTPATH + # process *.sh files in /etc/profiled.d for sh in /etc/profile.d/*.sh ; do [ -r "$sh" ] && . "$sh" |