From nobody Sun Jan 23 20:27:00 2022 X-Original-To: dev-commits-src-branches@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 B67BC198E8B0; Sun, 23 Jan 2022 20:27:01 +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 4Jhl5d1hrtz3HLP; Sun, 23 Jan 2022 20:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642969621; 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=LGe4k99YxxnUZFRSEcOSDyTaiDPi733JIArTVYh0738=; b=fq1q5O7ZUXhd30sMFbGEmr+0hXCvaD5/VpsZhRe3hUhPS7EfCwSm19rdbHRD8Z78ne/ZMo apaWZIJZbbh8wbCD7cRGJCO4sAgvjpXV476zlfKJ2WPvQUzKdNOD/JxGvKs6NVe9f428j3 VhOv7GmUTx8eoj2BF3NbmPXYagN09AN/a5Ul3Z+h4ln6cZvWtvJHhRGifB8iFq7jCU8BdY 7iiua6cQX890vbdQR0YaDEpFsnJ6AGvOhUXOeI86PqI7LAi1hSDdX012sFSUKT06ED4Be7 qx8AQTVlu4Hvtl7eZnqjBwc9gUBfhQQgrtupJZyx0v8mMdDgKk9wODxRXUK64g== 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 D6141CBD; Sun, 23 Jan 2022 20:27:00 +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 20NKR03Y004550; Sun, 23 Jan 2022 20:27:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20NKR09S004549; Sun, 23 Jan 2022 20:27:00 GMT (envelope-from git) Date: Sun, 23 Jan 2022 20:27:00 GMT Message-Id: <202201232027.20NKR09S004549@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: 28d0a7821adc - stable/12 - rc.d/ntp: Ensure ntpd.leap-seconds.list is readable by ntpd List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 28d0a7821adc1421b26c45b5cd8ab6532e55ba62 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642969621; 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=LGe4k99YxxnUZFRSEcOSDyTaiDPi733JIArTVYh0738=; b=RyrnlboHl+QrVThe2D8Dccu5iW6NXytWG9Wq+8MhL+dZ+v+CUCddu76sVZcjTEzM5YGfII XfRGLSUETuGyncDf9oZGpLlFV1CavrUUYzI/qkgJyUCsGIf0Q5mRRldai2xW70ltuwkHsM bXTOaplBGkfoSuOuqtgoyjv/TDMH/QFPVt8UGAcWlouqH9sQ5WsaGETYnpapdb8n+f8tJo Mr2iFbtH7jAfmSSYyP/SKaD8zqRhxlrxtbN43R1e/p2BDsgM9V3jzlR5NOFEoFf3DJnQLJ I5OY7HAPEEzjSp27Pizlfc6dtB9aa/Wa/5EvvPswhNiOUyufaB/21sRK+/MuFw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642969621; a=rsa-sha256; cv=none; b=wCX2NRS+w4L8P1nfEUg3ljTKEMFGqHUN5QN/+y5T9lPinDjd4MCl10QDA8txDWWvmT8tQg WQH7DfHz6Lds/RZwxZu2uVKRJP/Bda9cMdquPmY8vXatevYaA1xYuUzdwz4c0Jm7nshRB1 tOAb9/72hnCBvczhHLhcvJ6YwXMSH+KgpWwAO/Gg8JP/ktyLv+BzErX2goYvCzG3cbWrO3 CD6xwkw4XCOdAYFbeCy9CfuFL47RcvrIwnELQOtZDP7RGlGu8O79K0Fzothy3+srqmYQVp WQc/77/9SsX//iCuEHheTWdrQurTBBmW8CvxRToKRx1QFpn7PEpgmP6Ld/oKBA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=28d0a7821adc1421b26c45b5cd8ab6532e55ba62 commit 28d0a7821adc1421b26c45b5cd8ab6532e55ba62 Author: Cy Schubert AuthorDate: 2022-01-18 14:14:54 +0000 Commit: Cy Schubert CommitDate: 2022-01-23 20:24:36 +0000 rc.d/ntp: Ensure ntpd.leap-seconds.list is readable by ntpd When a use sets umask in login.conf(5) to 027 or 077 a subsequently fetched /var/db/ntpd.leap-seconds.list will inherit the permissions allowed by the umask, resulting in a file that may not be readable ntpd running under the ntp account. This patch adds a umask command to preempt the umask in login.conf(5) prior to fetching a new copy of the leap-seconds file. PR: 261298 Reported by: Martin Waschbusch (cherry picked from commit c6806434e79079f4f9419c3ba4fec37efcaa1635) --- libexec/rc/rc.d/ntpd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd index 8b32e3e19d5b..c1d2f52a01b7 100755 --- a/libexec/rc/rc.d/ntpd +++ b/libexec/rc/rc.d/ntpd @@ -221,6 +221,8 @@ ntpd_fetch_leapfile() { if ntpd_needfetch_leapfile ; then for url in $ntp_leapfile_sources ; do $verbose fetching $url + # Circumvent umask 027 and 077 in login.conf(5) + umask 022 fetch $ntp_leapfile_fetch_opts -o $_ntp_tmp_leapfile $url && break done ntp_ver_no_tmp=$(get_ntp_leapfile_ver $_ntp_tmp_leapfile)