Date: Tue, 5 Jan 2016 16:21:20 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293204 - in head: include lib/libc/gen usr.sbin/cron/crontab Message-ID: <201601051621.u05GLKUf084749@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Tue Jan 5 16:21:20 2016 New Revision: 293204 URL: https://svnweb.freebsd.org/changeset/base/293204 Log: 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 Modified: head/include/paths.h head/lib/libc/gen/exec.3 head/lib/libc/gen/posix_spawn.3 head/usr.sbin/cron/crontab/crontab.5 Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Tue Jan 5 16:08:26 2016 (r293203) +++ head/include/paths.h Tue Jan 5 16:21:20 2016 (r293204) @@ -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 Modified: head/lib/libc/gen/exec.3 ============================================================================== --- head/lib/libc/gen/exec.3 Tue Jan 5 16:08:26 2016 (r293203) +++ head/lib/libc/gen/exec.3 Tue Jan 5 16:21:20 2016 (r293204) @@ -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. Modified: head/lib/libc/gen/posix_spawn.3 ============================================================================== --- head/lib/libc/gen/posix_spawn.3 Tue Jan 5 16:08:26 2016 (r293203) +++ head/lib/libc/gen/posix_spawn.3 Tue Jan 5 16:21:20 2016 (r293204) @@ -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 Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Tue Jan 5 16:08:26 2016 (r293203) +++ head/usr.sbin/cron/crontab/crontab.5 Tue Jan 5 16:21:20 2016 (r293204) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 28, 2012 +.Dd January 5, 2016 .Dt CRONTAB 5 .Os .Sh NAME @@ -74,7 +74,7 @@ is set to .Pa /bin/sh , .Ev PATH is set to -.Pa /usr/bin:/bin , +.Pa /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin , and .Ev LOGNAME and
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601051621.u05GLKUf084749>