diff options
author | pyr <pyr@openbsd.org> | 2008-05-12 19:15:02 +0000 |
---|---|---|
committer | pyr <pyr@openbsd.org> | 2008-05-12 19:15:02 +0000 |
commit | fde55bc4cd8a3e2076c1c7ff399834cadba6abf9 (patch) | |
tree | 90f446aa0b0d4ae4c388f55034862a5e587ab4c2 /usr.sbin/hotplugd | |
parent | Remove clauses 3 and 4 from the license to match the license on (diff) | |
download | wireguard-openbsd-fde55bc4cd8a3e2076c1c7ff399834cadba6abf9.tar.xz wireguard-openbsd-fde55bc4cd8a3e2076c1c7ff399834cadba6abf9.zip |
Error out with usage line if additional arguments are given after the
option parsing. Found out the hard way by jdixon on ifstated.
ok sobrado@, jdixon@, millert@
Diffstat (limited to 'usr.sbin/hotplugd')
-rw-r--r-- | usr.sbin/hotplugd/hotplugd.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/hotplugd/hotplugd.c b/usr.sbin/hotplugd/hotplugd.c index 064d77600d4..546372e686e 100644 --- a/usr.sbin/hotplugd/hotplugd.c +++ b/usr.sbin/hotplugd/hotplugd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hotplugd.c,v 1.7 2006/05/28 16:44:52 mk Exp $ */ +/* $OpenBSD: hotplugd.c,v 1.8 2008/05/12 19:15:02 pyr Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -72,6 +72,11 @@ main(int argc, char *argv[]) /* NOTREACHED */ } + argc -= optind; + argv += optind; + if (argc > 0) + usage(); + if ((devfd = open(device, O_RDONLY)) == -1) err(1, "%s", device); |