]> granicus.if.org Git - apache/commitdiff
We never tested for invalid 'additional' arguments that were ignored.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 29 Nov 2001 07:10:40 +0000 (07:10 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 29 Nov 2001 07:10:40 +0000 (07:10 +0000)
  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

index 677ef0bb734cb79b4caebfe4b967e8c3bb7ffaa5..6c0c99a71666dd7de0470ab4693fc4ecb5212fc5 100644 (file)
@@ -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);
     }