1 |
commit: 277e5b9e55717873b87eb541a95f4f2ae0c60a4d |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 26 18:36:31 2018 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 26 19:35:11 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/baselayout.git/commit/?id=277e5b9e |
7 |
|
8 |
Add sbin directories to path |
9 |
|
10 |
This is a partial revert of 9cac4dd130637fa2c1f1a64bf3c9d2509284e6dd. |
11 |
We need to have path and rootpath be the same, to allow transitioning |
12 |
packages before we drop rootpath. |
13 |
|
14 |
etc/env.d/50baselayout | 1 + |
15 |
etc/profile | 10 ++++++++++ |
16 |
2 files changed, 11 insertions(+) |
17 |
|
18 |
diff --git a/etc/env.d/50baselayout b/etc/env.d/50baselayout |
19 |
index b10a2c4d..694a2336 100644 |
20 |
--- a/etc/env.d/50baselayout |
21 |
+++ b/etc/env.d/50baselayout |
22 |
@@ -2,6 +2,7 @@ |
23 |
# Do not edit this file |
24 |
|
25 |
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin" |
26 |
+ROOTPATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin" |
27 |
MANPATH="/usr/local/share/man:/usr/share/man" |
28 |
INFOPATH="/usr/share/info" |
29 |
CONFIG_PROTECT_MASK="/etc/gentoo-release" |
30 |
|
31 |
diff --git a/etc/profile b/etc/profile |
32 |
index 4579bd17..8e92e824 100644 |
33 |
--- a/etc/profile |
34 |
+++ b/etc/profile |
35 |
@@ -18,6 +18,16 @@ export PAGER=${PAGER:-/usr/bin/less} |
36 |
# 077 would be more secure, but 022 is generally quite realistic |
37 |
umask 022 |
38 |
|
39 |
+# Set up PATH depending on whether we're root or a normal user. |
40 |
+# There's no real reason to exclude sbin paths from the normal user, |
41 |
+# but it can make tab-completion easier when they aren't in the |
42 |
+# user's PATH to pollute the executable namespace. |
43 |
+if [ "${EUID-}" = "0" ] || [ "${USER-}" = "root" ] ; then |
44 |
+ PATH="${ROOTPATH}" |
45 |
+fi |
46 |
+export PATH |
47 |
+unset ROOTPATH |
48 |
+ |
49 |
# process *.sh files in /etc/profiled.d |
50 |
for sh in /etc/profile.d/*.sh ; do |
51 |
[ -r "$sh" ] && . "$sh" |