From: William A. Rowe Jr Date: Thu, 29 Nov 2001 07:10:40 +0000 (+0000) Subject: We never tested for invalid 'additional' arguments that were ignored. X-Git-Tag: 2.0.30~338 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f6e70ed8d39997a31bf3f44602698e014562354;p=apache 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 --- 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); }