From: Eric Covener Date: Tue, 25 Jun 2013 02:48:25 +0000 (+0000) Subject: *) core: merge AllowEncodedSlashes from the base configuration into X-Git-Tag: 2.5.0-alpha~5296 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=286e82c27d652c7a26521107aa8de84283daa42a;p=apache *) core: merge AllowEncodedSlashes from the base configuration into (non-default) name-based virtual hosts. [Eric Covener] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1496339 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 6016a7bb14..4320bb0835 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) core: merge AllowEncodedSlashes from the base configuration into + (non-default) name-based virtual hosts. [Eric Covener] + *) mod_headers: Add 'setifempty' command to Header and RequestHeader. [Eric Covener] diff --git a/include/ap_mmn.h b/include/ap_mmn.h index 1c98b5a425..d9d668ecba 100644 --- a/include/ap_mmn.h +++ b/include/ap_mmn.h @@ -432,6 +432,7 @@ * ap_condition_if_range() * 20121222.13 (2.5.0-dev) Add ap_proxy_clear_connection() * 20121222.14 (2.5.0-dev) Add ap_map_http_request_error() + * 20121222.15 (2.5.0-dev) Add allow/decode_encoded_slashes_set to core_dir_config */ #define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */ @@ -439,7 +440,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20121222 #endif -#define MODULE_MAGIC_NUMBER_MINOR 14 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 15 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a diff --git a/include/http_core.h b/include/http_core.h index d6fb3ab357..80ce6cdd96 100644 --- a/include/http_core.h +++ b/include/http_core.h @@ -617,6 +617,8 @@ typedef struct { /** Max number of Range reversals (eg: 200-300, 100-125) allowed **/ int max_reversals; + unsigned int allow_encoded_slashes_set : 1; + unsigned int decode_encoded_slashes_set : 1; } core_dir_config; /* macro to implement off by default behaviour */ diff --git a/server/core.c b/server/core.c index 799ce60522..eda46a4794 100644 --- a/server/core.c +++ b/server/core.c @@ -398,8 +398,12 @@ static void *merge_core_dir_configs(apr_pool_t *a, void *basev, void *newv) conf->enable_sendfile = new->enable_sendfile; } - conf->allow_encoded_slashes = new->allow_encoded_slashes; - conf->decode_encoded_slashes = new->decode_encoded_slashes; + if (new->allow_encoded_slashes_set) { + conf->allow_encoded_slashes = new->allow_encoded_slashes; + } + if (new->decode_encoded_slashes_set) { + conf->decode_encoded_slashes = new->decode_encoded_slashes; + } if (new->log) { if (!conf->log) { @@ -2893,6 +2897,10 @@ static const char *set_allow2f(cmd_parms *cmd, void *d_, const char *arg) cmd->cmd->name, " must be On, Off, or NoDecode", NULL); } + + d->allow_encoded_slashes_set = 1; + d->decode_encoded_slashes_set = 1; + return NULL; }