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>
This commit is contained in:
parent
b7c67e6414
commit
f71d1104df
10
configure.ac
10
configure.ac
|
@ -1846,6 +1846,16 @@ AS_IF([test "x$enable_sulogin_emergency_mount" = xyes], [
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
AC_ARG_ENABLE([usrdir-path],
|
||||||
|
AS_HELP_STRING([--enable-usrdir-path], [use only /usr paths in PATH env. variable (recommended on systems with /bin -> /usr/bin symlinks)]),
|
||||||
|
[], [enable_usrdir_path=no]
|
||||||
|
)
|
||||||
|
|
||||||
|
AS_IF([test "x$enable_usrdir_path" == xyes], [
|
||||||
|
AC_DEFINE([USE_USRDIR_PATHS_ONLY], [1], [Define to 1 to remove /bin and /sbin from PATH env.variable])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
AC_ARG_ENABLE([makeinstall-chown],
|
AC_ARG_ENABLE([makeinstall-chown],
|
||||||
AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
|
AS_HELP_STRING([--disable-makeinstall-chown], [do not do chown-like operations during "make install"]),
|
||||||
[], [enable_makeinstall_chown=yes]
|
[], [enable_makeinstall_chown=yes]
|
||||||
|
|
|
@ -20,10 +20,20 @@
|
||||||
|
|
||||||
/* DEFPATHs from <paths.h> don't include /usr/local */
|
/* DEFPATHs from <paths.h> don't include /usr/local */
|
||||||
#undef _PATH_DEFPATH
|
#undef _PATH_DEFPATH
|
||||||
|
|
||||||
|
#ifdef USE_USRDIR_PATHS_ONLY
|
||||||
|
# define _PATH_DEFPATH "/usr/local/bin:/usr/bin"
|
||||||
|
#else
|
||||||
# define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
|
# define _PATH_DEFPATH "/usr/local/bin:/bin:/usr/bin"
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef _PATH_DEFPATH_ROOT
|
#undef _PATH_DEFPATH_ROOT
|
||||||
|
|
||||||
|
#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"
|
# define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define _PATH_SECURETTY "/etc/securetty"
|
#define _PATH_SECURETTY "/etc/securetty"
|
||||||
#define _PATH_WTMPLOCK "/etc/wtmplock"
|
#define _PATH_WTMPLOCK "/etc/wtmplock"
|
||||||
|
|
Loading…
Reference in New Issue