From owner-svn-src-all@freebsd.org Mon Nov 25 21:29:44 2019 Return-Path: Delivered-To: svn-src-all@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 0DD671BAA29 for ; Mon, 25 Nov 2019 21:29:44 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound3d.ore.mailhop.org (outbound3d.ore.mailhop.org [54.186.57.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47MKtZ6vvrz3xkG for ; Mon, 25 Nov 2019 21:29:42 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1574717381; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=qbEsmDyfBJnVFii2PcuNpdN16ZxIa+soRpw3HOqz2wFoJ9tDK1U2fNpW6xIIVeEePh2hWoMs9ovXH 9zMSU/6vIbH3Z3NNf1Chlxh1pj7F1v+fgmav10iNX+MXwDcIpHn5U+wXMR4eIyKk/43I0JPrQj2/Gh wrTt1GGv13WdY3aUygJAcE9i0MlMiaJyuE1DX2qFabuue+/eeGbO4+slvkL8psTjwQCeUc2X4aO+aI isQUYFVxaf2ov/nPJ3WPODD0gGWJ2wKDR4czuQN+IhFuX5SQBW980djVGX0dUUyfnLwhpJ4/mWUzyW j55Lx8rtBm1d5b3JVYdb5wdJjeWq9Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:dkim-signature:from; bh=8W4fkv+cr/zGTKJYWsuzsslywLY4Fz0r8t+uKmw5TpQ=; b=en9nBXmWIZ1SqBEUJP4X0nR3PJAy3gDBQrKtq+GEiYTjImOGgHWVetS54cKp6CeuQeJppjPcAWCwf lpJQPyGbage2tJsoeQcfBJcSyC8zd4JAr9gMriqjNxkF83LGHbTO2mewEmJ7XUotTQj5E3zCtbXZt9 wjPa78gnjQVkvK0CP7p/+qO0570ipAs+QbATQuIRZ/IKGZ2lXyyH6OXbRAjBe2QvbLOsaMVRCnEgqr zBkUGql/of5G2W8IY+yu0RMs4RxEZjzBDkcFHYUJsmByFmech/pYNm1os/8euAoLTjyLJZKI1IGkAY 4jOmZZXae9DcRM7JT/37wO/QiNmDtgg== ARC-Authentication-Results: i=1; outbound3.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:cc:to:from:subject:message-id:from; bh=8W4fkv+cr/zGTKJYWsuzsslywLY4Fz0r8t+uKmw5TpQ=; b=MD7mu198CcCJDYPWuj6Pi6sXXelyQ3P+4lEja7zSLjZbiBpGwwXm05bkQisKAJ8v337QZhqcD3BY8 MhI3ewuBwJdxu/KV511MYEm6TmFDhJPLcEffcc+Xgja6UlzRxkTFk6pcrHfWjsNw/JeqTjr7KEhrfm M1kK+0RDcYIQoMuSJ7H7o/slmSz/bk4EcZD32I6s0ukhRuSvlApdhIvCeuhrZvM6QCIqYKzGnH/R+7 9Lnp5hJ109FDPoEJWm7IeE6Qh/aj4zFU8hAn9jK1+FZujwIRNl3ZssWydGOQ/05Kk0Y1nut9x0LC+c O1MSGe0R2T0fQKI/dfNKccfwfUj2iuQ== X-MHO-RoutePath: aGlwcGll X-MHO-User: af7062bd-0fca-11ea-b80c-052b4a66b6b2 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound3.ore.mailhop.org (Halon) with ESMTPSA id af7062bd-0fca-11ea-b80c-052b4a66b6b2; Mon, 25 Nov 2019 21:29:40 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id xAPLTcHK070209; Mon, 25 Nov 2019 14:29:38 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <258a8c29c86afd8a39c2de7c12426c9dcde9c97f.camel@freebsd.org> Subject: Re: svn commit: r355100 - head/libexec/rc/rc.d From: Ian Lepore To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 25 Nov 2019 14:29:38 -0700 In-Reply-To: <201911252025.xAPKPtBh004212@slippy.cwsent.com> References: <201911251959.xAPJxsJa088257@repo.freebsd.org> <201911252025.xAPKPtBh004212@slippy.cwsent.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47MKtZ6vvrz3xkG X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-1.67 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-0.81)[-0.815,0]; NEURAL_HAM_LONG(-0.85)[-0.851,0]; ASN(0.00)[asn:16509, ipnet:54.186.0.0/15, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Nov 2019 21:29:44 -0000 On Mon, 2019-11-25 at 12:25 -0800, Cy Schubert wrote: > In message <201911251959.xAPJxsJa088257@repo.freebsd.org>, Ian > Lepore > writes: > > Author: ian > > Date: Mon Nov 25 19:59:53 2019 > > New Revision: 355100 > > URL: https://svnweb.freebsd.org/changeset/base/355100 > > > > Log: > > Allow opt-out of automatic ntpd leapfile checking/fetching. > > > > When a system has no internet connection, or when it is > > configured to obtai > > n > > ntpd leapfiles from some source other than the internet, or even > > when the > > sysadmin has decided for some reason to customize ntp.conf to > > eliminate use > > of the leapfile, the rc.d/ntpd script emits various error > > messages related > > to the file. > > > > This change allows setting the rc var ntp_db_leapfile to NONE to > > disable al > > l > > automatic processing related to that file in rc.d/ntpd. > > > > Reviewed by: cy As already indicated in: > > Differential Revision: https://reviews.freebsd.org/D22461 -- Ian > > > > Modified: > > head/libexec/rc/rc.d/ntpd > > > > Modified: head/libexec/rc/rc.d/ntpd > > =================================================================== > > ========== > > = > > --- head/libexec/rc/rc.d/ntpd Mon Nov 25 19:38:05 2019 (r3 > > 55099) > > +++ head/libexec/rc/rc.d/ntpd Mon Nov 25 19:59:53 2019 (r3 > > 55100) > > @@ -28,6 +28,16 @@ pidfile="${_ntp_default_dir}/${name}.pid" > > > > load_rc_config $name > > > > +leapfile_is_disabled() { > > + # Return true (0) if automatic leapfile handling is disabled. > > + case "$ntp_db_leapfile" in > > + [Nn][Oo] | [Nn][Oo][Nn][Ee] ) > > + return 0;; > > + * ) > > + return 1;; > > + esac > > +} > > + > > can_run_nonroot() > > { > > # If the admin set what uid to use, we don't change it. > > @@ -107,7 +117,12 @@ ntpd_precmd() > > command_args="${command_args} -g" > > fi > > > > - # Make sure the leapfile is ready to use. > > + # Make sure the leapfile is ready to use, unless leapfile > > + # handling is disabled. > > + if leapfile_is_disabled; then > > + return > > + fi > > + > > ntpd_init_leapfile > > if [ ! -f "${ntp_db_leapfile}" ]; then > > ntpd_fetch_leapfile > > @@ -135,6 +150,11 @@ get_ntp_leapfile_expiry() { > > } > > > > ntpd_init_leapfile() { > > + > > + if leapfile_is_disabled; then > > + return > > + fi > > + > > # Refresh working leapfile with an invalid hash due to > > # FreeBSD id header. Ntpd will ignore leapfiles with a > > # mismatch hash. The file must be the virgin file from > > @@ -146,7 +166,12 @@ ntpd_init_leapfile() { > > > > ntpd_needfetch_leapfile() { > > local rc verbose > > - > > + > > + if leapfile_is_disabled; then > > + # Return code 1: ntp leapfile fetch not needed > > + return 1 > > + fi > > + > > if checkyesno ntp_leapfile_fetch_verbose; then > > verbose=echo > > else > > @@ -182,6 +207,11 @@ ntpd_needfetch_leapfile() { > > } > > > > ntpd_fetch_leapfile() { > > + > > + if leapfile_is_disabled; then > > + return > > + fi > > + > > if checkyesno ntp_leapfile_fetch_verbose; then > > verbose=echo > > else > > > >