From owner-svn-src-head@freebsd.org Fri Oct 23 09:22:24 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6D2E944168C; Fri, 23 Oct 2020 09:22:24 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CHdzh1Y46z3dCh; Fri, 23 Oct 2020 09:22:24 +0000 (UTC) (envelope-from se@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19C7E255AA; Fri, 23 Oct 2020 09:22:24 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 09N9MNwt040924; Fri, 23 Oct 2020 09:22:23 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 09N9MNZu040921; Fri, 23 Oct 2020 09:22:23 GMT (envelope-from se@FreeBSD.org) Message-Id: <202010230922.09N9MNZu040921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Fri, 23 Oct 2020 09:22:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366962 - in head: include usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head: include usr.bin/calendar X-SVN-Commit-Revision: 366962 X-SVN-Commit-Repository: base 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.33 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: Fri, 23 Oct 2020 09:22:24 -0000 Author: se Date: Fri Oct 23 09:22:23 2020 New Revision: 366962 URL: https://svnweb.freebsd.org/changeset/base/366962 Log: Add search of LOCALBASE/share/calendar for calendars supplied by a port. Calendar files in LOCALBASE override similarily named ones in the base system. This could easily be changed if the base system calendars should have precedence, but it could lead to a violation of POLA since then the port's files were ignored unless those in base have been deleted. There was no definition of _PATH_LOCALBASE in paths.h, but verbatim uses of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to ease a consistent modification of this prefix. Reviewed by: imp, pfg Differential Revision: https://reviews.freebsd.org/D26882 Modified: head/include/paths.h head/usr.bin/calendar/io.c head/usr.bin/calendar/pathnames.h Modified: head/include/paths.h ============================================================================== --- head/include/paths.h Fri Oct 23 08:44:53 2020 (r366961) +++ head/include/paths.h Fri Oct 23 09:22:23 2020 (r366962) @@ -37,8 +37,11 @@ #include +#define _PATH_LOCALBASE "/usr/local" + /* Default search path. */ -#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" /* All standard utilities path. */ #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" /* Locate system binaries. */ Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Fri Oct 23 08:44:53 2020 (r366961) +++ head/usr.bin/calendar/io.c Fri Oct 23 09:22:23 2020 (r366962) @@ -71,7 +71,7 @@ enum { }; const char *calendarFile = "calendar"; /* default calendar file */ -static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* HOME */ +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, _PATH_INCLUDE}; /* HOME */ static const char *calendarNoMail = "nomail";/* don't sent mail if file exist */ static char path[MAXPATHLEN]; Modified: head/usr.bin/calendar/pathnames.h ============================================================================== --- head/usr.bin/calendar/pathnames.h Fri Oct 23 08:44:53 2020 (r366961) +++ head/usr.bin/calendar/pathnames.h Fri Oct 23 09:22:23 2020 (r366962) @@ -35,3 +35,4 @@ #include #define _PATH_INCLUDE "/usr/share/calendar" +#define _PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar"