From bc1825e6c8ac20353229461593bfd62678954ced Mon Sep 17 00:00:00 2001 From: Lars Wendler Date: Tue, 29 May 2018 09:04:03 +0200 Subject: [PATCH] Re-add ROOTPATH stuff in sbin usually is not meant to be accessible by users This reverts the following commits: 9cac4dd130637fa2c1f1a64bf3c9d2509284e6dd 8974c87e2d0e243c0fc2503fac5b40f447fac65f --- etc/env.d/50baselayout | 2 +- etc/profile | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/etc/env.d/50baselayout b/etc/env.d/50baselayout index 694a2336..e8662e0e 100644 --- a/etc/env.d/50baselayout +++ b/etc/env.d/50baselayout @@ -1,7 +1,7 @@ # /etc/env.d/50baselayout # Do not edit this file -PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin" +PATH="/usr/local/bin:/usr/bin:/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" diff --git a/etc/profile b/etc/profile index 2afd51d9..05584351 100644 --- a/etc/profile +++ b/etc/profile @@ -18,6 +18,14 @@ 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/profile.d -- 2.39.1