From bdee3abaa14d336720f20370aee7cdcd09d7b183 Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Tue, 4 Dec 2012 02:20:17 +0000 Subject: [PATCH] Merge r1415008, r1416150 from https://svn.apache.org/repos/asf/httpd/httpd/trunk/: PR54222: catch invalid ServerTokens args Submitted by: Jackie Zhang Reviewed/modified by: covener Sort error message for ServerTokens by increasing verbosity. Add missing 'OS' variant. Remove some trailing whitespace. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1416746 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 9 --------- server/core.c | 5 ++++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/CHANGES b/CHANGES index 64d03cf093..9b70819132 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.4.4 + *) core: Fail startup if the argument to ServerTokens is unrecognized. + [Jackie Zhang ] + *) 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] diff --git a/STATUS b/STATUS index b612d76996..34e235c5da 100644 --- a/STATUS +++ b/STATUS @@ -97,15 +97,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK: 2.4.x patch: http://people.apache.org/~jailletc36/backport_mod_dumpio.patch +1: jailletc36, sf, druggeri - * core: fail startup if ServerTokens arg is unrecognized, PR54222 - trunk patch: http://svn.apache.org/viewvc?rev=1415008&view=rev - http://svn.apache.org/viewvc?rev=1416150&view=rev - 2.4.x patch: trunk works - +1: covener, sf, druggeri - Is fail startup okay? What about warn and set to PROD? - sf: I think that's ok. It will be immediately obvious after upgrade and - is easy to fix in the configuration. - * core: Accept "Include /some/dir" without wildcards as documented, regression from 2.2.x. PR54223 trunk patch: http://svn.apache.org/viewvc?rev=1415023&view=rev diff --git a/server/core.c b/server/core.c index 03137577de..a09c8a05cb 100644 --- a/server/core.c +++ b/server/core.c @@ -3222,9 +3222,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, 'Prod', 'Major', 'Minor', 'Min', 'OS', or 'Full'"; + } return NULL; } -- 2.40.0