]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
PR54222: catch invalid ServerTokens args
authorEric Covener <covener@apache.org>
Thu, 29 Nov 2012 00:24:44 +0000 (00:24 +0000)
committerEric Covener <covener@apache.org>
Thu, 29 Nov 2012 00:24:44 +0000 (00:24 +0000)
Submitted by: Jackie Zhang  <jackie.qq.zhang gmail.com>
Reviewed/modified by: covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1415008 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/core.c

diff --git a/CHANGES b/CHANGES
index 9e0d080c247ba07ac5303c9475ab3c7e75865aba..3522152c0b374d9c5d404163b6272bd3b55daa6c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) core: Fail startup if the argument to ServerTokens is unrecognized.
+     [Jackie Zhang  <jackie.qq.zhang gmail.com>]
+
   *) mod_log_forensic: Don't log a spurious "-" if a request has been rejected
      before mod_log_forensic could attach its id to it. [Stefan Fritsch]
 
index c6c47d33601b84f2ba1315d12ede0f41a31f70b1..65bdff0de864dfe6cff901869bc31c09b8e37125 100644 (file)
@@ -3234,9 +3234,12 @@ static const char *set_serv_tokens(cmd_parms *cmd, void *dummy,
     else if (!strcasecmp(arg1, "Prod") || !strcasecmp(arg1, "ProductOnly")) {
         ap_server_tokens = SrvTk_PRODUCT_ONLY;
     }
-    else {
+    else if (!strcasecmp(arg1, "Full")) { 
         ap_server_tokens = SrvTk_FULL;
     }
+    else { 
+        return "ServerTokens takes 1 argument, 'Min', 'Major', 'Minor', 'Prod', or 'Full'";
+    }
 
     return NULL;
 }