From nobody Wed Oct 12 10:08:09 2022 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 4MnSyf296cz4dxM3; Wed, 12 Oct 2022 10:08:10 +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 4MnSyf1cnwz3jk1; Wed, 12 Oct 2022 10:08:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665569290; 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=Z97YDLRLHUM2NxT3uj5XQBHRbYdGzR8hCw4wP4O+nXM=; b=SWAhNOKF5eBVybOyghfofjb2wJDx643x0YXcApIOp7NVRh6sTmf7YP6TdNv31VW6ITjCyU bl+sRkvBeMM9wYBTZXxC+azVk/YlMjBgmbC1bNjukkPdKri4NbkS2Qc8HDKLkAJbjVPAsw 7gq/mZmFh8vsqmrtMD9xvGa4HhMbi7XSGbw3MIQvm6NVNSz6hZZYpA2rRg6N1DBtaCebW7 MAI9ZjE7JeJsiUvFcsT8DibQVYXatZhb/6+iegaJW/GYy9Iup2QDW++C5M+qvyGcuM/oGp roza5BOvvTNRZ3usC0wNbYCmVeJn3WSscWg17VFXTcByx3H/pLgdFd7jcUj18Q== 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 4MnSyf0RbHz1Gpy; Wed, 12 Oct 2022 10:08:10 +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 29CA8969006831; Wed, 12 Oct 2022 10:08:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 29CA89fR006830; Wed, 12 Oct 2022 10:08:09 GMT (envelope-from git) Date: Wed, 12 Oct 2022 10:08:09 GMT Message-Id: <202210121008.29CA89fR006830@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Baptiste Daroussin Subject: git: c0358afd5bbc - main - pw: exit with an error in case of using an illegal option 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: bapt X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0358afd5bbc2c675941fed2905479ad109770bb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1665569290; 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=Z97YDLRLHUM2NxT3uj5XQBHRbYdGzR8hCw4wP4O+nXM=; b=rvLyKICAPglY6V3bXCBNPkhr85Of19WipPda4r7nkZu94uey258AVYYntXV3mdcxe3SA14 WO9CnoMofH5NuuaJ/nbik6tjEMrHbs/hFxJtUE4rdUbjF/FA4BFn3vnG+RA9+A2695Nh6s lZypQ09usf/1yrkK5NpsF0dzEbHCE7GNxUMjAKh/OvMVbj/h7Jq75oILh6hBDBBoct1rcy jGFUOUEI7B8OjvrqAtQKFQ09ufHEUk1tBxatQld05O012Bj788Q3ULhqfWZHxsZGYt6ts0 YjIQoi/cFUP8s+VJcakaJgbDK9rR0AVLrj1RJEqi8hw/6ShBfn55iXLMknq/rQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1665569290; a=rsa-sha256; cv=none; b=xaRYpq/qh1WoPSIgqTxrxL0QqwI6qiNYFbGFWRE9T8NISxAVNndarz6jsJB4DRD018/of+ rHzjD4vq1LwxShP7ikvUOe0PETkCbyFB1RfOCK5w0yTihCaXW77x/E7wnqOV6Edc/u2Bru RM2CE5S3bd0yE2BLSJqfhCVY5RHkVnohAd7WEckxCOqIXY1ID43MLWW2q03MKeKp10fYx0 O65nxLj1Bm2KDgHo+hRL3DRI3OmV/tY1uyk7tyBcc46AGvtVJ0YkXUp04rBvEzGJopbspv 2lkliNXv6n415fogkSMmAE0+r9o7Ki4x5zrGCYpSU/de0ac29arYK7nL6DVNsA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bapt: URL: https://cgit.FreeBSD.org/src/commit/?id=c0358afd5bbc2c675941fed2905479ad109770bb commit c0358afd5bbc2c675941fed2905479ad109770bb Author: Baptiste Daroussin AuthorDate: 2022-10-12 10:06:32 +0000 Commit: Baptiste Daroussin CommitDate: 2022-10-12 10:06:32 +0000 pw: exit with an error in case of using an illegal option PR: 263188 Reported by: Dennis Clarke MFC After: 1 week --- 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 653fb1cb0dfb..7dd84d468f1f 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -723,6 +723,8 @@ pw_user_next(int argc, char **argv, char *name __unused) case 'q': quiet = true; break; + default: + exit(EX_USAGE); } } @@ -785,6 +787,8 @@ pw_user_show(int argc, char **argv, char *arg1) case '7': v7 = true; break; + default: + exit(EX_USAGE); } } @@ -866,6 +870,8 @@ pw_user_del(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } } @@ -1003,6 +1009,8 @@ pw_user_lock(int argc, char **argv, char *arg1) case 'q': /* compatibility */ break; + default: + exit(EX_USAGE); } } @@ -1020,6 +1028,8 @@ pw_user_unlock(int argc, char **argv, char *arg1) case 'q': /* compatibility */ break; + default: + exit(EX_USAGE); } } @@ -1287,6 +1297,8 @@ pw_user_add(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } } @@ -1595,6 +1607,8 @@ pw_user_mod(int argc, char **argv, char *arg1) case 'Y': nis = true; break; + default: + exit(EX_USAGE); } }