From: William A. Rowe Jr Date: Wed, 21 Jan 2015 21:39:55 +0000 (+0000) Subject: Revert r4635428 corresponding to PR41867. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18995785af7d3a7ab1113a4c61061f7a3c99b153;p=thirdparty%2Fapache%2Fhttpd.git Revert r4635428 corresponding to PR41867. The code reverted attempted to restrict comparisons of the r->filename to given DirectoryMatch blocks. r->filename was already a non-directory entity at this point, because we have already fallen out of the } while (thisinfo.filetype == APR_DIR); block above. The addition of r->d_is_directory was redundant. That is what is always returned by ap_get_core_module_config(r->per_dir_config). Note modifying dir_config required an MMN major bump as this commit could have realigned the offset of refs (had it been added to the end, this would correspond to an mmn minor bump) and other fields packed into the same bytes (this is undefined). Bump on revert to prevent unexpected crashes. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1653666 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/include/http_core.h b/include/http_core.h index 2143d5a74d3..33430880cb7 100644 --- a/include/http_core.h +++ b/include/http_core.h @@ -619,7 +619,6 @@ typedef struct { unsigned int allow_encoded_slashes_set : 1; unsigned int decode_encoded_slashes_set : 1; - unsigned int d_is_directory : 1; /** Named back references */ apr_array_header_t *refs; diff --git a/server/core.c b/server/core.c index bc6ae0820b0..2cad01bbc62 100644 --- a/server/core.c +++ b/server/core.c @@ -2238,7 +2238,6 @@ static const char *dirsection(cmd_parms *cmd, void *mconfig, const char *arg) conf->r = r; conf->d = cmd->path; conf->d_is_fnmatch = (apr_fnmatch_test(conf->d) != 0); - conf->d_is_directory = 1; if (r) { conf->refs = apr_array_make(cmd->pool, 8, sizeof(char *)); diff --git a/server/request.c b/server/request.c index daa2d39fa70..736c4c444ee 100644 --- a/server/request.c +++ b/server/request.c @@ -1216,13 +1216,6 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r) pmatch = apr_palloc(rxpool, nmatch*sizeof(ap_regmatch_t)); } - /* core_dir_config is Directory*, but the requested file is - * not a directory, so although the regexp could match, - * we skip it. */ - if (entry_core->d_is_directory && r->finfo.filetype != APR_DIR) { - continue; - } - if (ap_regexec(entry_core->r, r->filename, nmatch, pmatch, 0)) { continue; }