From nobody Tue Sep 12 14:19:04 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 4RlQgX47vqz4t21m; Tue, 12 Sep 2023 14:19:04 +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 4RlQgX2ZQgz4PJ8; Tue, 12 Sep 2023 14:19:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694528344; 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=w6skAdTkJDvb9xMTM/NkOXdw2lHDo2V4vDW4oVa/4SE=; b=TaPmSsZSwIYg5575qt0auAx46rPo3AnxKeB0UkihvQiTU/TwKsLwzqJvNdeVy/+zXPo95W SEKCp0WFMqzPEaGD2k9jf68WtvY5zcqWqzvYeWG0GO57u6C/dnPvOkDaAYGCniMIb3XJmU L1H2nBDrsEbh/zMLHsEFYEdZW6E16ofQk48bw/D5JJiHG4ZOVkyQukOf8MRmpS4CefBB+Z ypQzGhpUUEHF1jBNUDlH7YDljGCr495o3S4jrB+4Xq/uuB66PRiykroBLkihJKH8ZKbVeL BXMK2Gei1SrKnXEbINJ1jjtNidIw5gw7x3YD4/jnD0FoUyHnwwcPI54V2gSC/w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694528344; a=rsa-sha256; cv=none; b=a6dBsrIhYmiZbWfRV04C7hoxUWkY8psHzsNd0sFe2NmbjPIgEPxeGbBL0NvciFPw/oeCPd vhwvLUybtgrfQxN8GLQ2V4SkAxqDxquQCDkuEvPdYvI1YkFiMFGukgRnU2dbQMZDVuRVCg fBzkdmSMtQ4WvoBuEfp7HIL7Wl10STl00lqUlGW9s8I83jGW5hMpd3gpeENEPQNPMswcBC Qr6qR6j8VUD8UvgJVPuU2SEtHTovhVvZ3/TSBtRJA2mGz4sgZYiSbZDaZK/TnyKRFfnZ8u pE4MRWqtIr9gs5mIMYVv/2YOfaDcBuZFiU0J3OPa4xrIpQq+hUDYj3ngRiVvRA== 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=1694528344; 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=w6skAdTkJDvb9xMTM/NkOXdw2lHDo2V4vDW4oVa/4SE=; b=AmTk2SOLO9Ur3Nm3PB+jvW8B1I0ZsWSzoPuKXqYMmIDmSk8fosZituaLBgWrNP7pzpMjPb 8jS1n59DJa8oUCbfcb+xE3u2kHkmYTBjKFzNi62Zm/+ki79eYYFPh5S6fxhGZEQOGM2Od4 uQ0V2F3EepIwwbwVU43W03QUU4Rf+ePAkCoGXklrhBKXWGGlzG9yO/stHAOauqTZzoAu+Z vQsHSnkqqTF74k0gyi/CbGhiObDV4i+gvLTfgNev/YuHfT69UNg1RA2fY7bA6IQAmFn6Bq m+ioeI8tZdadhMbTCtXjrTiwCU54G4DADMthWpQL+c+q6JLW3ycn0LPTh6u07w== 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 4RlQgX1gmvzb3r; Tue, 12 Sep 2023 14:19:04 +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 38CEJ4fA020249; Tue, 12 Sep 2023 14:19:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38CEJ4kh020246; Tue, 12 Sep 2023 14:19:04 GMT (envelope-from git) Date: Tue, 12 Sep 2023 14:19:04 GMT Message-Id: <202309121419.38CEJ4kh020246@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: deaa6984ada8 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: deaa6984ada80e36aea2f16e5f7211dd0d14800c Auto-Submitted: auto-generated The branch stable/14 has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=deaa6984ada80e36aea2f16e5f7211dd0d14800c commit deaa6984ada80e36aea2f16e5f7211dd0d14800c Author: Mike Karels AuthorDate: 2023-09-08 14:06:42 +0000 Commit: Mike Karels CommitDate: 2023-09-12 14:18:52 +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 436481bad14c..6602dbc09aa0 100644 --- a/usr.sbin/mountd/mountd.c +++ b/usr.sbin/mountd/mountd.c @@ -319,6 +319,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; @@ -1757,6 +1758,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; @@ -3393,6 +3399,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); @@ -3426,9 +3433,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; @@ -3443,7 +3447,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; } }