From nobody Fri Sep 08 14:07:12 2023 X-Original-To: dev-commits-src-main@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 4Rhybh4bh7z4svRP; Fri, 8 Sep 2023 14:07:12 +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 4Rhybh46s3z4bh6; Fri, 8 Sep 2023 14:07:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694182032; 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=LYMLw29Z0DShSKrU2PWwhyaU5YwFx/YANtHildQNSEE=; b=m2MF5Bkb0XVgVIg7bPvPfNj5IZvfhmFdOIkuy7fQggxxSvw4hGUBMpknM0K9zbODBavx6n 5Xq8Eyhru+OePGSTL0ShJ/MPH8cWKMqUl938CKweXILBG2yBoI5pINmRvJ1NglOO2iMRlE /A5kGRAUStwIDp/OtTc06+91Xw3xo9TB/HL9qqZDAbXT1DOJ0Z8EkPNRJm+Cr6JgYJKQ1x 1moDItPDbnbwTyUxwAufUc84IPFNhgOLOeg184gBgWAo/NVpZDhbFEAdVR3zLRCb0MoMXD p5TqogN5GaFk7VD6oR/zY9s+fkR3WVnAW0mbROKrQjGwU1E2AU2/fuMfPuA+wA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694182032; a=rsa-sha256; cv=none; b=h7fPVwxFIPJL8Pp3WXFpXHS6rU0AYgsk3HKgpo06rnWftgJrWQrK7PVi6ENii+Nwmsx3R6 pV1avMucl0/Ca5hl7qHztViVcyVD6Pa5qjr0VQvG/T9Qe6HQ2UChc2AGWFe5kus9xbs57W n1FqXCo0OfcB8My1NNFKLlAjov8VNtjJlRzM7e1Y29epzyu0Mb0XnOJTt8e8TSuBMaSt3m m9z0WiD1NRBK52ewoK9215cFVrd4RyeIkB4RXLm+lRQ16FbwZI/9cMn2ncM86gXJcqiG/r uzOzfwtU2X8FbwurTCISDBNunM5JFZuYwi1CFMFoIvCbnzOCwdM5H4mtSg46Sg== 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=1694182032; 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=LYMLw29Z0DShSKrU2PWwhyaU5YwFx/YANtHildQNSEE=; b=gVCBaQgLgnJLHUnVHEEGUZuJwdEh91S3wiLzW1shsUeQnY0vMaSLP6ZYe6ThtTNQQUA+s7 JfBI17E3FyabjedEu1FV6HjLogYIYiS3xReRyBJVQwCXke67p7lLugj0tOftCQqvM3htmh c01qMIJ4TZ98NcXx8jmtU8BxccqKBxxG4J1EDtwmxYsuxGuTKBhjBhzXQn9nRih3YYCrAl DdxvwR3EyFr9WiIm/oEijRmQBOFHFAR/RjfnLBy/a4e+PgJ6d+pyEtCuc1GVVPGl4G8ORL aXi+QxXlV+fmHJ9qz4jdrF3Vy9n+fPUuSUDmXH+KAaIzwPBXUgxMj9vyPZMi/Q== 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 4Rhybh36jfzklN; Fri, 8 Sep 2023 14:07: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 388E7C5l024750; Fri, 8 Sep 2023 14:07:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 388E7CVt024747; Fri, 8 Sep 2023 14:07:12 GMT (envelope-from git) Date: Fri, 8 Sep 2023 14:07:12 GMT Message-Id: <202309081407.388E7CVt024747@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mike Karels Subject: git: 48514c5724cd - main - mountd: do not warn about using class mask with -mask List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 48514c5724cdf3338dd6d220e5deee6178d7ee48 Auto-Submitted: auto-generated The branch main has been updated by karels: URL: https://cgit.FreeBSD.org/src/commit/?id=48514c5724cdf3338dd6d220e5deee6178d7ee48 commit 48514c5724cdf3338dd6d220e5deee6178d7ee48 Author: Mike Karels AuthorDate: 2023-09-08 14:06:42 +0000 Commit: Mike Karels CommitDate: 2023-09-08 14:06:42 +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 MFC after: 3 days Reviewed by: rmacklem Differential Revision: https://reviews.freebsd.org/D41774 --- 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; } }