summaryrefslogtreecommitdiffstats
path: root/include/pathnames.h
diff options
context:
space:
mode:
authorKarel Zak2015-03-03 11:36:59 +0100
committerKarel Zak2015-03-03 11:43:01 +0100
commitf71d1104df68e9ab7f06878c1c324566721acd66 (patch)
treee5dbce365fc74af2a663e3f016f657b746319a93 /include/pathnames.h
parentlibfdisk: add {first,last}-lba header to sfdisk scritps (diff)
downloadkernel-qcow2-util-linux-f71d1104df68e9ab7f06878c1c324566721acd66.tar.gz
kernel-qcow2-util-linux-f71d1104df68e9ab7f06878c1c324566721acd66.tar.xz
kernel-qcow2-util-linux-f71d1104df68e9ab7f06878c1c324566721acd66.zip
build-sys: add --enable-usrdir-path
The directories /{sbin,bin} are symliks to /usr/{sbin,bin} on many systems. This patch add new ./configure option to remove the non-usr paths from the default $PATH environment variable. The default $PATH is hardcoded in login(1) and can be overwritten by /etc/login.defs. default: ./test_pathnames | grep DEFPATH _PATH_DEFPATH /usr/local/bin:/bin:/usr/bin _PATH_DEFPATH_ROOT /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin --enable-usrdir-path: ./test_pathnames | grep DEFPATH _PATH_DEFPATH /usr/local/bin:/usr/bin _PATH_DEFPATH_ROOT /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin This patch does not modify install paths, you still have to care about --{bin,lib}dir configure options. Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/pathnames.h')
-rw-r--r--include/pathnames.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/include/pathnames.h b/include/pathnames.h
index cc01589cd..37f010997 100644
--- a/include/pathnames.h
+++ b/include/pathnames.h
@@ -20,10 +20,20 @@
/* DEFPATHs from <paths.h> don't include /usr/local */
#undef _PATH_DEFPATH
-#define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
+
+#ifdef USE_USRDIR_PATHS_ONLY
+# define _PATH_DEFPATH "/usr/local/bin:/usr/bin"
+#else
+# define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
+#endif
#undef _PATH_DEFPATH_ROOT
-#define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+
+#ifdef USE_USRDIR_PATHS_ONLY
+# define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"
+#else
+# define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
+#endif
#define _PATH_SECURETTY "/etc/securetty"
#define _PATH_WTMPLOCK "/etc/wtmplock"