From nobody Wed Oct 19 08:01:21 2022 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 4Msjq53XVMz4gDRB; Wed, 19 Oct 2022 08:01:21 +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 4Msjq52b9gz3xfT; Wed, 19 Oct 2022 08:01:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666166481; 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=VI387W7Q+iy1RYSSyxK4sXWZfRIG5cBib4qNdFSFE0I=; b=PF/aeF+GjtqVtUaXAti3XkTjuu/apN7snaWDAB6nWVgt8iZ/6I1ZsClp5bwqS3Y7SutjK/ WJYT0MO+5OF1aOl9spfRFW4rqZ0WKWmUAQ+6qnHcsXt+ciCQiNYSoFhHwMA96TfVR+C3ci mJAda437KjX5+Ika36/qn8UxsamR8w9kn0EzGgKmD/F2X0hgYnbx90RxTZwjA2StccPkT8 MlzgXuazGRU3LJD5PnlGuNZBL09DbFGVCsJ+6X4MGRWG8VFXolUbbYhRNwhHK3mV9ThjBS NAMxpyn01m5qDBeuRXoIwVHKpSNNCVlzUDyT14VufA4Bh242BLTJ51TOq8qW3g== 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 4Msjq51M4bzSHl; Wed, 19 Oct 2022 08:01:21 +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 29J81Lbe060493; Wed, 19 Oct 2022 08:01:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29J81LJt060492; Wed, 19 Oct 2022 08:01:21 GMT (envelope-from git) Date: Wed, 19 Oct 2022 08:01:21 GMT Message-Id: <202210190801.29J81LJt060492@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Baptiste Daroussin Subject: git: 06a079c69e84 - stable/13 - pw: exit with an error in case of using an illegal option 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 06a079c69e843a796c5956b8e9a79a35d3401f38 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1666166481; 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=VI387W7Q+iy1RYSSyxK4sXWZfRIG5cBib4qNdFSFE0I=; b=yqHSG42SOJJR7eOy0V0xKnXR6mdStohK/6bb5fL73tBxUIbh/4+g0EcvO0E3KG980RQu3f nhnT7SQ7LuOm3lTjPvh6u2A6mGlmijUJ4zqPHSumRqixIjbYqfLCudq8vb7nZV2b22Nodf 0Ym39QKPuvlzxJ3JwDWn5+HcLh7iN0Ub7+49g6SHVllsH1EVh1MJWVSD2M2dOqU9RqMhJv YDbP+feKUepXE5De65OuqeVSDIaaYtARi63WazXyGPrgr8tslovTVq1wH2KqOnBHwMxnzv 0Pe/2lent1wATSXK9Dgyf7l31lQ8L/yLnLu6pI8gy52CYkOOXEThUz2y8HyzOA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1666166481; a=rsa-sha256; cv=none; b=eupT2/GFH8jcapnMwA+R8kgSTmgw6h3opOQGB5qUXpXIfn+GiUpa6+nxD9zbFMbieMqURw RKF84pGjdMhOx1yYUVRxqQuC+VXSFDGaija5I99G2bDYqtc6cr8kbtWfFJONesZKZJ/HNb B39Fs+FKJHDbFIlZ+/YRgXIWFDsuIS6ubleiX136nlzOd4K9n+OiIPIEwnZ3n1EvbZ+L5q vhq/shSaLJO56obE5t7qcHs5xYvnoNQgthMozukUzgocO98SHlaoSNbKoPRxnqOvEOW8NZ bPooBesWNGZbAONTb12qVWu+OzoQriyQv8xOf6ybRLRWCRSwgAlVW/JjbAXPpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=06a079c69e843a796c5956b8e9a79a35d3401f38 commit 06a079c69e843a796c5956b8e9a79a35d3401f38 Author: Baptiste Daroussin AuthorDate: 2022-10-12 10:06:32 +0000 Commit: Baptiste Daroussin CommitDate: 2022-10-19 07:55:48 +0000 pw: exit with an error in case of using an illegal option PR: 263188 Reported by: Dennis Clarke MFC After: 1 week (cherry picked from commit c0358afd5bbc2c675941fed2905479ad109770bb) --- usr.sbin/pw/pw_group.c | 10 ++++++++++ usr.sbin/pw/pw_user.c | 14 ++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index a294d4ecbb5c..1f5979a5dd03 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -276,6 +276,8 @@ pw_group_next(int argc, char **argv, char *arg1 __unused) case 'q': quiet = true; break; + default: + exit(EX_USAGE); } } @@ -333,6 +335,8 @@ pw_group_show(int argc, char **argv, char *arg1) case 'a': all = true; break; + default: + exit(EX_USAGE); } } @@ -390,6 +394,8 @@ pw_group_del(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } } @@ -548,6 +554,8 @@ pw_group_add(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } } @@ -640,6 +648,8 @@ pw_group_mod(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } } if (quiet) diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index 2eec317b5e5b..f218ebdf8c13 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -754,6 +754,8 @@ pw_user_next(int argc, char **argv, char *name __unused) case 'q': quiet = true; break; + default: + exit(EX_USAGE); } } @@ -816,6 +818,8 @@ pw_user_show(int argc, char **argv, char *arg1) case '7': v7 = true; break; + default: + exit(EX_USAGE); } } @@ -897,6 +901,8 @@ pw_user_del(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } } @@ -1038,6 +1044,8 @@ pw_user_lock(int argc, char **argv, char *arg1) case 'q': /* compatibility */ break; + default: + exit(EX_USAGE); } } @@ -1055,6 +1063,8 @@ pw_user_unlock(int argc, char **argv, char *arg1) case 'q': /* compatibility */ break; + default: + exit(EX_USAGE); } } @@ -1322,6 +1332,8 @@ pw_user_add(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } } @@ -1630,6 +1642,8 @@ pw_user_mod(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } }