You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2014/12/02 13:43:23 UTC
svn commit: r1642852 - in /httpd/httpd/branches/2.4.x: ./ STATUS
docs/manual/rewrite/advanced.xml include/http_core.h server/core.c
server/request.c
Author: jim
Date: Tue Dec 2 12:43:23 2014
New Revision: 1642852
URL: http://svn.apache.org/r1642852
Log:
Merge r1635428 from trunk:
core: Do not match files when using DirectoryMatch. PR41867.
Submitted by: jkaluza
Reviewed/backported by: jim
Modified:
httpd/httpd/branches/2.4.x/ (props changed)
httpd/httpd/branches/2.4.x/STATUS
httpd/httpd/branches/2.4.x/docs/manual/rewrite/advanced.xml (props changed)
httpd/httpd/branches/2.4.x/include/http_core.h
httpd/httpd/branches/2.4.x/server/core.c
httpd/httpd/branches/2.4.x/server/request.c
Propchange: httpd/httpd/branches/2.4.x/
------------------------------------------------------------------------------
Merged /httpd/httpd/trunk:r1635428
Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1642852&r1=1642851&r2=1642852&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Tue Dec 2 12:43:23 2014
@@ -104,10 +104,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * core: Do not match files when using DirectoryMatch. PR 41867.
- trunk patch: http://svn.apache.org/r1635428
- 2.4.x patch: http://people.apache.org/~jkaluza/patches/httpd-2.4.x-directorymatch.patch
- +1: jkaluza, covener, ylavic
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
Propchange: httpd/httpd/branches/2.4.x/docs/manual/rewrite/advanced.xml
------------------------------------------------------------------------------
Merged /httpd/httpd/trunk/docs/manual/rewrite/advanced.xml:r1635428
Modified: httpd/httpd/branches/2.4.x/include/http_core.h
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/include/http_core.h?rev=1642852&r1=1642851&r2=1642852&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/include/http_core.h (original)
+++ httpd/httpd/branches/2.4.x/include/http_core.h Tue Dec 2 12:43:23 2014
@@ -597,6 +597,7 @@ typedef struct {
#define AP_CONDITION_ELSE 2
#define AP_CONDITION_ELSEIF (AP_CONDITION_ELSE|AP_CONDITION_IF)
unsigned int condition_ifelse : 2; /* is this an <If>, <ElseIf>, or <Else> */
+ unsigned int d_is_directory : 1; /* Whether core_dir_config is Directory* */
ap_expr_info_t *condition; /* Conditionally merge <If> sections */
Modified: httpd/httpd/branches/2.4.x/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/core.c?rev=1642852&r1=1642851&r2=1642852&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/core.c (original)
+++ httpd/httpd/branches/2.4.x/server/core.c Tue Dec 2 12:43:23 2014
@@ -2163,6 +2163,7 @@ static const char *dirsection(cmd_parms
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 *));
Modified: httpd/httpd/branches/2.4.x/server/request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/server/request.c?rev=1642852&r1=1642851&r2=1642852&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/server/request.c (original)
+++ httpd/httpd/branches/2.4.x/server/request.c Tue Dec 2 12:43:23 2014
@@ -1212,6 +1212,13 @@ AP_DECLARE(int) ap_directory_walk(reques
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;
}