summaryrefslogtreecommitdiffstats
path: root/include/paths.h
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2016-01-05 16:21:20 +0000
committerjilles <jilles@FreeBSD.org>2016-01-05 16:21:20 +0000
commit14b7155b883684caa7f973fd5dd7bc9e604e0dc2 (patch)
tree1d6df1e16925bef49c86dc9b9398f394e582272b /include/paths.h
parent189b511555b2c1ae5860054f62f0baacd2b4d01e (diff)
downloadFreeBSD-src-14b7155b883684caa7f973fd5dd7bc9e604e0dc2.zip
FreeBSD-src-14b7155b883684caa7f973fd5dd7bc9e604e0dc2.tar.gz
Add sbin and /usr/local directories to _PATH_DEFPATH.
Set _PATH_DEFPATH to /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the path in the default class in the default /etc/login.conf, excluding ~/bin which would not be expanded properly in a string constant. For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf, ~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and by cron. Especially the latter is a common trap (most recently in PR 204813). PR: 204813 Reviewed by: secteam (delphij), alfred
Diffstat (limited to 'include/paths.h')
-rw-r--r--include/paths.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/paths.h b/include/paths.h
index 89c9fc9..af18c26 100644
--- a/include/paths.h
+++ b/include/paths.h
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
/* Default search path. */
-#define _PATH_DEFPATH "/usr/bin:/bin"
+#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
/* All standard utilities path. */
#define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
/* Locate system binaries. */
@@ -108,7 +108,7 @@ __END_DECLS
#ifdef RESCUE
#undef _PATH_DEFPATH
-#define _PATH_DEFPATH "/rescue:/usr/bin:/bin"
+#define _PATH_DEFPATH "/rescue:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin"
#undef _PATH_STDPATH
#define _PATH_STDPATH "/rescue:/usr/bin:/bin:/usr/sbin:/sbin"
#undef _PATH_SYSPATH
OpenPOWER on IntegriCloud