From owner-svn-src-head@freebsd.org Tue Jan 5 16:21:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 255D8A62E6A; Tue, 5 Jan 2016 16:21:22 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0253E1CCC; Tue, 5 Jan 2016 16:21:21 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u05GLLgA084753; Tue, 5 Jan 2016 16:21:21 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u05GLKUf084749; Tue, 5 Jan 2016 16:21:20 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201601051621.u05GLKUf084749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 5 Jan 2016 16:21:20 +0000 (UTC) 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 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2016 16:21:22 -0000 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 /* 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