summaryrefslogtreecommitdiff
path: root/usr.sbin/ifstated/ifstated.c
diff options
context:
space:
mode:
authorPierre-Yves Ritschard <pyr@cvs.openbsd.org>2008-05-12 19:15:03 +0000
committerPierre-Yves Ritschard <pyr@cvs.openbsd.org>2008-05-12 19:15:03 +0000
commit87c7985f57f39ae3881695f2fc5b7079ab63c6b0 (patch)
tree3690460aeda8b64e13fee3f2d75588071eaf260e /usr.sbin/ifstated/ifstated.c
parent970ec1da0136707fa8b46e7b91d99c0d75e50d29 (diff)
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/ifstated/ifstated.c')
-rw-r--r--usr.sbin/ifstated/ifstated.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/ifstated/ifstated.c b/usr.sbin/ifstated/ifstated.c
index f13cff951b9..fd26017ddec 100644
--- a/usr.sbin/ifstated/ifstated.c
+++ b/usr.sbin/ifstated/ifstated.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ifstated.c,v 1.32 2007/11/27 18:50:00 stevesk Exp $ */
+/* $OpenBSD: ifstated.c,v 1.33 2008/05/12 19:15:02 pyr Exp $ */
/*
* Copyright (c) 2004 Marco Pfatschbacher <mpf@openbsd.org>
@@ -122,6 +122,11 @@ main(int argc, char *argv[])
}
}
+ argc -= optind;
+ argv += optind;
+ if (argc > 0)
+ usage();
+
if (opts & IFSD_OPT_NOACTION) {
if ((newconf = parse_config(configfile, opts)) == NULL)
exit(1);