From nobody Tue Jan 18 15:35:15 2022 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 3B739196736F; Tue, 18 Jan 2022 15:35:16 +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 4JdXsJ0PBFz3RD3; Tue, 18 Jan 2022 15:35:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642520116; 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=S3mtrLJQWjjwhffNJKHguJgXNg9C9ZlxtiopHr5A/TY=; b=cyvIxmDptu0QJCl0Azy7TuaotY7hwPLXHPncXjJ7P3kDkE/bniclzmAXQYHRiNyRV8YvXJ VQ5X+cb2L1NTKBj9poAINLLIYEDBb23du/2GT+H14TESJWD0fP/16IdXzytJCMpanovXHt inFXKk1PVgbfJ3ZyHAlCYFqMk1Vw9lAdfWQuwUFF+e4MOLzATNso38Er3LjZE82a7YrrOl 4QXl7Y0ez7ZJ9yak6SmPkUKVXb0R9DmGkHSms66629xzEsmOVba7utni6EGtxys1TkIicG tV+aQi2BozabJ5NmyLC9ETLkMkI3Bq2KwlcAty8VONWvie6jkwJfr4qsjFtseg== 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 E2A0523E99; Tue, 18 Jan 2022 15:35:15 +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 20IFZFUf076499; Tue, 18 Jan 2022 15:35:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20IFZFH5076498; Tue, 18 Jan 2022 15:35:15 GMT (envelope-from git) Date: Tue, 18 Jan 2022 15:35:15 GMT Message-Id: <202201181535.20IFZFH5076498@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Cy Schubert Subject: git: c6806434e790 - main - rc.d/ntp: Ensure ntpd.leap-seconds.list is readable by ntpd 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: cy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c6806434e79079f4f9419c3ba4fec37efcaa1635 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642520116; 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=S3mtrLJQWjjwhffNJKHguJgXNg9C9ZlxtiopHr5A/TY=; b=eBvoJflnGpkU7clLuloSTvknPTih/PKLc+BWQyFhQsaR6yI3ipE640jPfOw3ri/UHtz1n0 tHaoJ9cwy9t4ir4W/4NDtsURI1lSuLBOPFn6FFliDMUvdBp1Ah3elo1a4VFXuv4u3LVOr8 JhOKyf5s5AvUzphebkW6f6nPiXr0Dn94b0XwWTYX8fjwGiH9kPf9Xm92S1YxgW03frSJcS pl04aaQy7Njr9jCZu1rvbQsRa3tkEx47Xf6pEjkOInS7kVTespzA9xjrN3Oe4vXf+jBOqk 2HibNOxJ35TSvreJLuKGUdrIwJB25ENSdK3nRTS65nEkD0aOX6C4292GspU3bw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642520116; a=rsa-sha256; cv=none; b=Dk/SQoQFSnVUyE7ikPikT/swwpG5JOmHljgEug2URV+NgR65rizedr7C/4zcRDUumeL+B2 YBP5JMe7FFAFK4Qz+UrNyhHnDMrRbRaz2psT3/dMKq0Bv/JZQFboYVR/dbzOiGx9r5rCr4 qC/T+HkfyKF0Tq0LokPxbFcfgjoiXbyMtu2LqCt7KO7PyYOzYkPpCtCxFoP1pmUTrU5PRO XFjXbFD39Odkw0X+vVNQ3ATFs9kflHv9b4Z89Y/hfzV/WeUy9lPwYy5+1/ZhKZwaZDj3Fa S8uEs6d6Us304xV8FCDTGWEBm3RumTDrkeFnfNIFo8MjXDyGdIvbUxhveX56Qw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=c6806434e79079f4f9419c3ba4fec37efcaa1635 commit c6806434e79079f4f9419c3ba4fec37efcaa1635 Author: Cy Schubert AuthorDate: 2022-01-18 14:14:54 +0000 Commit: Cy Schubert CommitDate: 2022-01-18 14:21:00 +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 MFC after: 3 days --- 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)