]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Revert r4635428 corresponding to PR41867.
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 21 Jan 2015 21:39:55 +0000 (21:39 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 21 Jan 2015 21:39:55 +0000 (21:39 +0000)
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

include/http_core.h
server/core.c
server/request.c

index 2143d5a74d3ba1d129d49e8b862603d395a56d2d..33430880cb75acf4c354504f48bed20b7f55154f 100644 (file)
@@ -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;
index bc6ae0820b00f4321d78c6aa46e586d2a1ad667f..2cad01bbc62eb54d7641c433cf8159fbc672f8ea 100644 (file)
@@ -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 *));
index daa2d39fa70a5be4b03e2f745498fc93371bd81c..736c4c444ee81af3ad718eccf065d07b1bcca787 100644 (file)
@@ -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;
             }