From owner-freebsd-current@freebsd.org Mon Oct 26 13:24:52 2020 Return-Path: Delivered-To: freebsd-current@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 A75304456BC for ; Mon, 26 Oct 2020 13:24:52 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (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 "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CKbD43xtwz4GZk; Mon, 26 Oct 2020 13:24:52 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-WLAN.fritz.box (p200300cd5f0bbc00cca8037de6f87d0d.dip0.t-ipconnect.de [IPv6:2003:cd:5f0b:bc00:cca8:37d:e6f8:7d0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 1F0AE23464; Mon, 26 Oct 2020 13:24:52 +0000 (UTC) (envelope-from se@freebsd.org) To: FreeBSD CURRENT From: Stefan Esser Subject: Literal references to /usr/local in shell scripts Message-ID: Date: Mon, 26 Oct 2020 14:24:50 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2020 13:24:52 -0000 The following shell scripts (or configuration files parsed by a shell) contain literal references to /usr/local: libexec/rc/rc.conf # many variables libexec/rc/rc.shutdown # PATH component sys/conf/newvers.sh # search for svnversion, git, hg usr.bin/man/man.sh # man_default_path, config_local usr.sbin/autofs/autofs/include_ldap # path to ldapsearch usr.sbin/autofs/autofs/special_media # path to mount.exfat, ntfs-3g usr.sbin/bsdconfig/bsdconfig # BSDCFG_LOCAL_LIBE usr.sbin/certctl/certctl.sh # TRUSTPATH, BLACKLISTPATH usr.sbin/crashinfo/crashinfo.sh # path to gdb usr.sbin/periodic/periodic.conf # local_periodic variable On systems with non-default LOCALBASE these scripts need to be adjusted. In the case of rc.shutdown, for example, shutdown routines will not be executed for a LOCALBASE other then /usr/local. The rc.shutdown, autofs/*, certctl.sh, and crashinfo scripts will be run with root privileges and must not use an untrusted LOCALBASE value (but could refer to a sysctl variable). The same applies to the periodic script that relies on the local_periodic variable set in periodic.conf (but probably overridden in periodic.conf.local, if required). rc.conf could use a $LOCALBASE variable instead of literal values to construct paths to port/package provided files in order to not require that each value is modified in the systems /etc/rc.conf file - which will fail if new variables referring to /usr/local are introduced in the default configuration). The list of shell scripts checked excludes those in contrib, release, tests, and tools directories, since I think those will be used with default LOCALBASE, in general.