From nobody Sun Jan 23 20:25:52 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 62D7E198E12A; Sun, 23 Jan 2022 20:25:53 +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 4Jhl4J6SXdz3G8D; Sun, 23 Jan 2022 20:25:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642969553; 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=bLPZL56rfhXr95qH9O+XlZnFAT7O7dBpWBNtlPqXPDQ=; b=FnXuwczcY9VaX5gA104CjEAuv2kLbXigTqVa7R05XlPE2joCUt8sUzrVgIgEKOWdywjr4x UDBUSGN0ONLJKxmEPFJQ97kIWtWMcwt0FR6y1y+8Dk5Qb1vsn+MWDhjYkIrRy0d4rvrCc1 xjDhSDTMklNdXi/h8VbdDYtuucSL3YSt5/Ibi2RiiU8WG9ay9ek7lm8biz3fbS27JBzkmF I8XDmWONrbKem+hki9b96oXzGYVYku+S7sWnn5m8H/XfoyVMELnJ6j4kyZDsUrDRqQkhc3 PVh05CAPYROHrNtq4gL5GaWYoMSSwdntCVZ9vVX5DGCYrnGrYCcpoLYgVVvGsA== 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 BD2B3DF7; Sun, 23 Jan 2022 20:25:52 +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 20NKPqAR004355; Sun, 23 Jan 2022 20:25:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20NKPqqc004354; Sun, 23 Jan 2022 20:25:52 GMT (envelope-from git) Date: Sun, 23 Jan 2022 20:25:52 GMT Message-Id: <202201232025.20NKPqqc004354@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: bb66b7c06e1c - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: bb66b7c06e1cfd688632e11716d0064cb0385183 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642969553; 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=bLPZL56rfhXr95qH9O+XlZnFAT7O7dBpWBNtlPqXPDQ=; b=GR0uUnTyG1x0JZ4IdHTBqbC0GEjECXML84422oVcBmNJe6+vXlD+7NVdr0EloRSKSV+45l nl9Ue0oIHYbvLDg+n8LwUBajHCFdJP8XO+uyjHpbHxhSKItgiy48TuaD7zwv1JpDJF7c1x gwhWO6goKWUQYFBm/TO+jmS2DNobrG2UCBBz4D4OcAU2J9gr6TkiQEIYxchzNL+VRCP92S 0jlj8gAVgKYcwT7i6Rcawb6cUr/I4PxvEyn9ejlxdTrn4/twnX6QoFExmc4eNoWfx8F/SS lD96FiVNluG8F5iCEwR0uQ47wt2jYjhL+McswShfHuvF/LSGB3GSORAUqJ+FOw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642969553; a=rsa-sha256; cv=none; b=wlBL4pNT/DtalP4bzWzmq76Khip8pbMwmIkT6aUebEpS4qITSR7ljMaa9i4y84SnFRRE+v 2jcny+8Lsik2bgFSH/CHrduOsvrIXqT4JNJAcuEyEbY9crb/oY980dhrNvCh7IqCK08ei1 mgyjWtK1X47pibVskVPYHLbq3lyvadhflmCIPjgIM6IdfZxxvKwoFo3ejFwNIBP8qztPgS LG8c0yGe+fiFNuatAoviiL2C7AFpfw7G9jwLE8SrSpFts4CeNuQTRtsFsf/ZfPoZw80CtH KZpxtJ6mcvNDSCufJID8KbHuWJONkrNZ6JlxdnnFKijAnm+8K3ceLFO1BdB7Og== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=bb66b7c06e1cfd688632e11716d0064cb0385183 commit bb66b7c06e1cfd688632e11716d0064cb0385183 Author: Cy Schubert AuthorDate: 2022-01-18 14:14:54 +0000 Commit: Cy Schubert CommitDate: 2022-01-23 20:23:08 +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)