From nobody Fri Dec 10 16:29:14 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 75C4618D66F5; Fri, 10 Dec 2021 16:29:15 +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 4J9bvZ516wz3F5M; Fri, 10 Dec 2021 16:29:14 +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 592E91D89A; Fri, 10 Dec 2021 16:29:14 +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 1BAGTEGc076981; Fri, 10 Dec 2021 16:29:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BAGTEbq076980; Fri, 10 Dec 2021 16:29:14 GMT (envelope-from git) Date: Fri, 10 Dec 2021 16:29:14 GMT Message-Id: <202112101629.1BAGTEbq076980@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mike Karels Subject: git: e5d4e532a0dc - stable/13 - mountd: deprecate exports to a network without mask 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: karels X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: e5d4e532a0dcf6c8073998848eb6e035fd18c0ca Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639153754; 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=h0d5hnVnCex/gaR+rlw1d0MYe9awy0awJXDz6TS7IwM=; b=XnUXX/dha3fR18jFFdsCuacm0qXxxvUQvds6RC6VHBuDVPL184gUIkUwVv2YFj/Sxy1dbW lFVJBiZAhTx0YztSpTRMQ7Fbow3pILIyM+jluOg7Qf6DIogKB9VjhZoMgL3XVG2f5BTEov g/yIJHt23iLwmGa3pJBwkkBboDZdRLtMqK/ufnWCzAbm3PXKpuxu2EgvYbt4X1iJ1hjnq+ CgbfwEZC1DLhRh6X1069OWpahVy3CkSjPbPfflP63lH7+a0kmpnPfquSi5RR9eenENnHZg od2FiAQ+k9KlFbJzrt7c0KX0fDDWbHJrtAq/LMZyz2iOhqu04/ozkxiA51jkhg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639153754; a=rsa-sha256; cv=none; b=wcKvDt9/4Uqlh35NmfAV3AV/RfUA2gP/1E269vfiumY4WCVxgTCpsfjOO9CH0Y3S83vbQZ Ic42fs6K9IxaLspoidiGvkC30WKPYDnm0t8cbuOc5pFR6Q039gTSVGj/DuJxKYji4TigWr nsZsmBfpnr+rTeSiKtUupwQwX7RAbJbfvK+huQrUf9PKg6pFEMs8ijCU+0OtlMv56iQpkW fmlYoEroJBnqhOW80uvVBVmJJnXY5ashk8gUnA4dSoKIsqgLpmMtsjHkbAWCh5p/QNAhVp cDebm555Ma6oGdzwNUKPQyfdfHmg4D5a68iK4NNEkGxgM2V9/ka1OHP65eIWYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=e5d4e532a0dcf6c8073998848eb6e035fd18c0ca commit e5d4e532a0dcf6c8073998848eb6e035fd18c0ca Author: Mike Karels AuthorDate: 2021-10-27 03:48:23 +0000 Commit: Mike Karels CommitDate: 2021-12-10 16:26:37 +0000 mountd: deprecate exports to a network without mask The exports file format allows export to a network using an explicit mask or prefix length (CIDR). It also allows a network with just a dotted address, in which case the historical mask was used. Deprecate this usage, and warn when it is used. Document that this is deprecated. (cherry picked from commit 92aebdeaff57091c77398912accb4c758c6a0fcb) --- usr.sbin/mountd/exports.5 | 7 ++++--- usr.sbin/mountd/mountd.c | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/mountd/exports.5 b/usr.sbin/mountd/exports.5 index bba10ddc7be1..d5aa49a1f428 100644 --- a/usr.sbin/mountd/exports.5 +++ b/usr.sbin/mountd/exports.5 @@ -28,7 +28,7 @@ .\" @(#)exports.5 8.3 (Berkeley) 3/29/95 .\" $FreeBSD$ .\" -.Dd November 20, 2020 +.Dd November 9, 2021 .Dt EXPORTS 5 .Os .Sh NAME @@ -338,9 +338,10 @@ to the option, or by using a separate .Fl mask option. -If the mask is not specified, it will default to the mask for that network -class (A, B or C; see +If the mask is not specified, it will default to the historical mask +for that network class (A, B, or C; see .Xr inet 4 ) . +This usage is deprecated, and will elicit a warning log message. See the .Sx EXAMPLES section below. diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 0c077b857d7e..569ea0fbf707 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -3418,6 +3418,9 @@ get_net(char *cp, struct netmsk *net, int maskflg) (opt_flags & OP_MASK) == 0) { in_addr_t addr; + syslog(LOG_WARNING, + "WARNING: No mask specified for %s, " + "using out-of-date default", name); addr = ((struct sockaddr_in *)sa)->sin_addr.s_addr; if (IN_CLASSA(addr)) preflen = 8; @@ -3425,7 +3428,7 @@ get_net(char *cp, struct netmsk *net, int maskflg) preflen = 16; else if (IN_CLASSC(addr)) preflen = 24; - else if (IN_CLASSD(addr)) + else if (IN_CLASSD(addr)) /* XXX Multicast??? */ preflen = 28; else preflen = 32; /* XXX */