[canopy-httpd] r1121 committed - check if there are any untreated arguments after the getopt() loop and...

0 views
Skip to first unread message

codesite...@google.com

unread,
Dec 14, 2010, 11:46:21 PM12/14/10
to canopy-s...@googlegroups.com
Revision: 1121
Author: phrakt
Date: Tue Dec 14 20:45:24 2010
Log: check if there are any untreated arguments after the getopt() loop and
exit
with EX_USAGE if there are

http://code.google.com/p/canopy-httpd/source/detail?r=1121

Modified:
/trunk/src/sbin/httpd/httpd.c

=======================================
--- /trunk/src/sbin/httpd/httpd.c Sun Dec 12 13:29:18 2010
+++ /trunk/src/sbin/httpd/httpd.c Tue Dec 14 20:45:24 2010
@@ -317,6 +317,14 @@
break; /* NOTREACHED */
}
}
+
+ argc -= optind;
+ argv += optind;
+
+ if (argc != 0) {
+ httpd_usage();
+ httpd_exit(EX_USAGE);
+ }

if (httpd_subsys_init() == -1)
errx(EX_SOFTWARE, "failed to initialize subsystem manager");

Reply all
Reply to author
Forward
0 new messages