From e7c9998b3b2593eb312e9bf3c69d2d06e628d03a Mon Sep 17 00:00:00 2001 From: cheloha Date: Wed, 3 Aug 2022 00:23:14 +0000 Subject: [PATCH] dmesg(8): don't accept positional arguments dmesg(8) doesn't use any positional arguments. If we see any, it's a usage error. ok florian@, "Sure" deraadt@ millert@ --- sbin/dmesg/dmesg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sbin/dmesg/dmesg.c b/sbin/dmesg/dmesg.c index 4d63370e9ab..1b4ef99e5b9 100644 --- a/sbin/dmesg/dmesg.c +++ b/sbin/dmesg/dmesg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dmesg.c,v 1.31 2019/12/24 13:20:44 bluhm Exp $ */ +/* $OpenBSD: dmesg.c,v 1.32 2022/08/03 00:23:14 cheloha Exp $ */ /* $NetBSD: dmesg.c,v 1.8 1995/03/18 14:54:49 cgd Exp $ */ /*- @@ -89,6 +89,9 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (argc != 0) + usage(); + if (memf == NULL && nlistf == NULL) { int mib[2], msgbufsize; size_t len; -- 2.20.1