summaryrefslogtreecommitdiffstats
path: root/lib
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 /lib
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 'lib')
-rw-r--r--lib/libc/gen/exec.34
-rw-r--r--lib/libc/gen/posix_spawn.34
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/gen/exec.3 b/lib/libc/gen/exec.3
index c9d32b4..0805c62 100644
--- a/lib/libc/gen/exec.3
+++ b/lib/libc/gen/exec.3
@@ -28,7 +28,7 @@
.\" @(#)exec.3 8.3 (Berkeley) 1/24/94
.\" $FreeBSD$
.\"
-.Dd December 12, 2015
+.Dd January 5, 2016
.Dt EXEC 3
.Os
.Sh NAME
@@ -161,7 +161,7 @@ the default path is set according to the
definition in
.In paths.h ,
which is set to
-.Dq Ev /usr/bin:/bin .
+.Dq Ev /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin .
For
.Fn execvP ,
the search path is specified as an argument to the function.
diff --git a/lib/libc/gen/posix_spawn.3 b/lib/libc/gen/posix_spawn.3
index 2c9131b..ebbf05a 100644
--- a/lib/libc/gen/posix_spawn.3
+++ b/lib/libc/gen/posix_spawn.3
@@ -34,7 +34,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 17, 2011
+.Dd January 5, 2016
.Dt POSIX_SPAWN 3
.Os
.Sh NAME
@@ -126,7 +126,7 @@ the default path is set according to the
definition in
.In paths.h ,
which is set to
-.Dq Ev /usr/bin:/bin .
+.Dq Ev /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin .
.Pp
If
.Fa file_actions
OpenPOWER on IntegriCloud