From nobody Tue Dec 21 02:58:59 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4CD1C18F9F0F; Tue, 21 Dec 2021 02:59:00 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JJ1Pb65tQz4l6C; Tue, 21 Dec 2021 02:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC5E622003; Tue, 21 Dec 2021 02:58:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BL2wxJt071678; Tue, 21 Dec 2021 02:58:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BL2wxHm071677; Tue, 21 Dec 2021 02:58:59 GMT (envelope-from git) Date: Tue, 21 Dec 2021 02:58:59 GMT Message-Id: <202112210258.1BL2wxHm071677@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Peter Wemm Subject: git: 81a48881c631 - main - periodic: Use a deterministic $PATH for periodic. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: peter X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 81a48881c63149e5fc104e158ed3d71a2ec659a7 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640055539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ktzNMmafzN//5RkFpf9NeLCk9SgXK/yaTvVOLoYVyCw=; b=DBTmZOzmA03e2gv05MsKP5DCye+Rd/jLwC4eR1CktrIlFPsBNdbFIxGOhRc3EpFGbPeACV Iy4uNO48LmFArMp35bEBd7cMOVifIHudPK84TJPkJbrBPgR2k1KDxJGgnIiLuFUpJZK20p t3IUaIHJu395I2rqcXwnNb3Q/P7KP8vpTBLrmvYAltl7tUsHM9dYqL3RiiMK2o59pmxyst urAhFKkM6/FLoVm3aXjDYMl1TSyhiUi3Pkz2PBktmYt+HKUZIab/IKSWpkGOrDpT6i+4sR U/s4Uy7Rxbpy6Vt9RaMJPTQXkk+gHXW1p3GE8pV8EME3vsrEhu93uAez6kivjw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640055539; a=rsa-sha256; cv=none; b=SyBunEljtbaxjj005bKcz7C/jH3q2DWP2pR6el602/GPkwqYCCi7mSlCp7LPeRNZWaxtgH YLU8qsgjDbEK2sfS2eDT1a9+BwVE8J1OT4ksY8dmtmQ10hFm2w+cXxe6I0841Vsu/b034a 8go4UqRne/Z4x7rHWT/tSjOz7QesGC2LWNtgWqXX8xPPme8gWmT1//MVKtyCpMvu/hEFut U5OdGRZu8mHWjZ/yjJQDpCEPJ4ivsIh87e786SZlATEAyuSd+t0bBD3wKt0qCEP/bgtPuY mrba27gdY72/b2hERqpgSNUA29R0rZzUW/vg9FMVg2QR8zHsevR2t6zyKT2bYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by peter: URL: https://cgit.FreeBSD.org/src/commit/?id=81a48881c63149e5fc104e158ed3d71a2ec659a7 commit 81a48881c63149e5fc104e158ed3d71a2ec659a7 Author: Peter Wemm AuthorDate: 2021-12-21 01:08:04 +0000 Commit: Peter Wemm CommitDate: 2021-12-21 02:54:56 +0000 periodic: Use a deterministic $PATH for periodic. Various tools can have alternate versions elsewhere, eg: the GNU mailutils port (a dependency of emacs*) brings /usr/local/bin/mail. Match the preset PATH in /etc/crontab for deterministic path searches even when run manually with a different environment. PR: 259265 Reported by: iandstanley@gmail.com --- usr.sbin/periodic/periodic.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/periodic/periodic.sh b/usr.sbin/periodic/periodic.sh index 84e14e9cfd80..26413c4ab51e 100644 --- a/usr.sbin/periodic/periodic.sh +++ b/usr.sbin/periodic/periodic.sh @@ -30,6 +30,10 @@ if [ $# -lt 1 ] ; then usage fi +# Use a deterministic path to match the preset from /etc/crontab in case +# periodic is run interactively. +export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin + # If possible, check the global system configuration file, # to see if there are additional dirs to check if [ -r /etc/defaults/periodic.conf ]; then