summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'etc/profile')
-rw-r--r--etc/profile10
1 files changed, 10 insertions, 0 deletions
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"