From nobody Tue Sep 12 14:19:12 2023 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 4RlQgj0xGGz4t275; Tue, 12 Sep 2023 14:19:13 +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 4RlQgj06C8z4PML; Tue, 12 Sep 2023 14:19:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694528353; 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=r3srCNDMBeFpTZ+/XJKdALmAmg3qX5JQG2qQX4PXF84=; b=sCJaZT7qbfKFm17fk0G5UXJn/XU15S2kN7hqo5jAeGk0Ip110mrDju8Ocov4gD8gBh6gCe FIozYR2wUXuqv3o+98tgEPa6n+SpYB0EY0JnYU1QtvH73FR/w0OAHferLdpzTIBbsu+TW/ j5QfS43ibkxdu/cN6ZH8O+yNSearmSAk8ImwVpbG9L6hV/5vRRoRD1ZZ55RJJqZ/Ouot+A NfrdWlpe1gbAiSIzZPxFrbqhF8gxbPXkBgocUp2XB6pW9Yee45a14eNlTuRN1l+KWE9wLS lYfFEjHDRgSPk0EsfYrgqgSfZRiEDSo9d6cXqiKz8uCeyQ+oCG+kX1SJ6Cxajg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694528353; a=rsa-sha256; cv=none; b=OwWQXhrHu9GMO9uDJAGEWEvTYJ0K+2qT9MAhRcV9Pi9d4vUQH5ElUJOLV9oitJkXaf8y7i frE/31Zg/1TKNpF54eBMOI8ZI9poWcgZvQyfHkcct+sftKZHUUA24XBiacIOhIQgPxeqQP 8qD7LPs+uzQvE8ajop+WhgD+GmW/58AzscAfeFllMNl1wDbBx45fAJManpAvY7+Z+55dfp lCdde0aqYBH0gtXGWgfyvSP+dn+o9X1mHB2bWdWXRrac/mZBc4uMx2yWirZvZeKQFhVQLc lyhp4w++DYZYTnRC6xhooa1oZ8ijnxcSC6XJh0YGu269IDv6de0GgDIIjjaFdA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694528353; 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=r3srCNDMBeFpTZ+/XJKdALmAmg3qX5JQG2qQX4PXF84=; b=IXr+qdSMisCDmw32V5yZif4Z6h9Ql1fIQTsc6/rj1hWHE1Q1kI2pWuOYm0/WohhsY14BVx xg1tCC73sj9hRGkI4iylWUJi5BkiRMKkSbrmlUBcnZsLvEzum+0dOdCMlCes0yZQoULPoM 1E3kmPZijT9tfiTo/T5+nArSDQQ+dgvVXW0RaCpItCRT0OOC6QaIJQjiEY9H/dThN61+Hj OdRJ9vH4HhU27NWickkZY4G1WX8JykRKP62sLRN6hOyfC+9zl3ae/egb+iRIimqTkQXwnz Vwr7T6K4ODhwSumLfPGuTN8KgTd7Ucyya75udZzr6vUChUbfX9jET8CzjHui3A== 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 4RlQgh6KYCzZvK; Tue, 12 Sep 2023 14:19:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38CEJC0G020411; Tue, 12 Sep 2023 14:19:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38CEJChE020408; Tue, 12 Sep 2023 14:19:12 GMT (envelope-from git) Date: Tue, 12 Sep 2023 14:19:12 GMT Message-Id: <202309121419.38CEJChE020408@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: 79ce96abd6c5 - stable/13 - mountd: do not warn about using class mask with -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: 79ce96abd6c5dee2ddb2e35755c7ff9156510d81 Auto-Submitted: auto-generated The branch stable/13 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=79ce96abd6c5dee2ddb2e35755c7ff9156510d81 commit 79ce96abd6c5dee2ddb2e35755c7ff9156510d81 Author: Mike Karels AuthorDate: 2023-09-08 14:06:42 +0000 Commit: Mike Karels CommitDate: 2023-09-12 14:18:33 +0000 mountd: do not warn about using class mask with -mask The previous code would warn that the mask was being defaulted to an obsolete class mask even if -mask was present after -network. Import a fix from Peter Much with a little tweaking, deferring the warning until after all parameters are processed. PR: 263011 Obtained from: pmc at citilink.dinoex.sub.org Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D41774 (cherry picked from commit 48514c5724cdf3338dd6d220e5deee6178d7ee48) --- usr.sbin/mountd/mountd.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c index 34c3387c6236..eba59ebf00a4 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -317,6 +317,7 @@ static struct pidfh *pfh = NULL; #define OP_QUIET 0x100 #define OP_MASKLEN 0x200 #define OP_SEC 0x400 +#define OP_CLASSMASK 0x800 /* mask not specified, is Class A/B/C default */ #ifdef DEBUG static int debug = 1; @@ -1747,6 +1748,11 @@ get_exportlist_one(int passno) nextfield(&cp, &endcp); len = endcp - cp; } + if (opt_flags & OP_CLASSMASK) + syslog(LOG_WARNING, + "WARNING: No mask specified for %s, " + "using out-of-date default", + (&grp->gr_ptr.gt_net)->nt_name); if (check_options(dirhead)) { getexp_err(ep, tgrp, NULL); goto nextline; @@ -3383,6 +3389,7 @@ get_net(char *cp, struct netmsk *net, int maskflg) goto fail; bcopy(sa, &net->nt_mask, sa->sa_len); opt_flags |= OP_HAVEMASK; + opt_flags &= ~OP_CLASSMASK; } else { /* The specified sockaddr is a network address. */ bcopy(sa, &net->nt_net, sa->sa_len); @@ -3416,9 +3423,6 @@ 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; @@ -3433,7 +3437,7 @@ get_net(char *cp, struct netmsk *net, int maskflg) bcopy(sa, &net->nt_mask, sa->sa_len); makemask(&net->nt_mask, (int)preflen); - opt_flags |= OP_HAVEMASK; + opt_flags |= OP_HAVEMASK | OP_CLASSMASK; } }