git: bc997ea6b81e - stable/13 - id: sanitize arguments better
Alan Somers
asomers at FreeBSD.org
Sat Jul 3 23:29:58 UTC 2021
The branch stable/13 has been updated by asomers:
URL: https://cgit.FreeBSD.org/src/commit/?id=bc997ea6b81eace14f999e782502ae060687db2c
commit bc997ea6b81eace14f999e782502ae060687db2c
Author: Alan Somers <asomers at FreeBSD.org>
AuthorDate: 2021-06-11 16:38:07 +0000
Commit: Alan Somers <asomers at FreeBSD.org>
CommitDate: 2021-07-03 23:29:41 +0000
id: sanitize arguments better
The -[AMc] flags ignore the user argument. Better if id rejects
invocations that include a user argument along with any of those flags.
PR: 256554
Reviewed by: trasz
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D30734
(cherry picked from commit 4a06e9377398b34922f8a67d7cb3ea980b95bde8)
---
usr.bin/id/id.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/usr.bin/id/id.c b/usr.bin/id/id.c
index 5abfb655c948..b8988dedd6f6 100644
--- a/usr.bin/id/id.c
+++ b/usr.bin/id/id.c
@@ -144,6 +144,8 @@ main(int argc, char *argv[])
if (iswhoami && argc > 0)
usage();
+ if ((cflag || Aflag || Mflag) && argc > 0)
+ usage();
switch(Aflag + Gflag + Mflag + Pflag + gflag + pflag + uflag) {
case 1:
More information about the dev-commits-src-branches
mailing list