From 6ff94e2a76cc3ab1fce3653a7634bb7fc00292b7 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Thu, 29 Nov 2001 07:10:40 +0000 Subject: [PATCH] We never tested for invalid 'additional' arguments that were ignored. Was there any point to allowing additional, unused args after the various supported switches? This prevents the Apache server from starting with an httpd somefooness invocation. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92241 13f79535-47bb-0310-9956-ffa450edef68 --- server/main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/main.c b/server/main.c index 677ef0bb73..6c0c99a716 100644 --- a/server/main.c +++ b/server/main.c @@ -374,7 +374,16 @@ int main(int argc, const char * const argv[]) } } - if (rv != APR_EOF) { /* bad cmdline option */ + /* bad cmdline option? then we die */ + if (rv != APR_EOF) { + usage(process); + } +// C:\apache2\bin\apache.exe: illegal option -- q + /* 'extra' argument ignored? then we die */ + if (opt->ind < opt->argc) { + ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, + "Unused argument %s\n", + opt->argv[opt->ind]); usage(process); } -- 2.50.1