]> granicus.if.org Git - apache/commitdiff
PR49809: Allow DirectoryMatch to match the EOL character ($). and
authorEric Covener <covener@apache.org>
Fri, 27 Aug 2010 10:46:02 +0000 (10:46 +0000)
committerEric Covener <covener@apache.org>
Fri, 27 Aug 2010 10:46:02 +0000 (10:46 +0000)
stop applying to subdirectories (that don't also match the regex) implicitly.

The manual already uses DirectoryMatch syntax that assumes this in other places!

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@990091 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
docs/manual/mod/core.html.en
docs/manual/mod/core.xml
server/request.c

diff --git a/CHANGES b/CHANGES
index a0cced613cccf53e1cba99466daf521c7240b9cb..b7cea31f4a3c126810a709b88d14e1f4dc8b2a1c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.3.9
 
+  *) core: DirectoryMatch can now match on the end of line character ($),
+     and sub-directories of matched directories are no longer implicitly
+     matched.  PR49809 [Eric Covener]
 
 Changes with Apache 2.3.8
 
index 9658c43124d3c9922aeba976c146ef8aeaa03a56..6cca6ed13d0b9e098f7a4475f6a447981637f6e7 100644 (file)
@@ -742,10 +742,10 @@ subdirectories</td></tr>
 </table>
     <p><code class="directive">&lt;DirectoryMatch&gt;</code> and
     <code>&lt;/DirectoryMatch&gt;</code> are used to enclose a group
-    of directives which will apply only to the named directory and
-    sub-directories of that directory, the same as <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>. However, it
-    takes as an argument a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular 
-    expression</a>. For example:</p>
+    of directives which will apply only to the named directory
+    the same as <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>. 
+    However, it takes as an argument a 
+    <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>.  For example:</p>
 
     <div class="example"><p><code>
       &lt;DirectoryMatch "^/www/(.+/)?[0-9]{3}"&gt;
@@ -754,6 +754,20 @@ subdirectories</td></tr>
     <p>would match directories in <code>/www/</code> that consisted of three
     numbers.</p>
 
+   <div class="note"><h3>Compatability</h3>
+      Prior to 2.3.9, this directive implicitly applied to sub-directories
+      (like <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>) and
+      could not match the end of line symbol ($).  In 2.3.9 and later,
+      only directories that match the expression are affected by the enclosed
+      directives.
+    </div>
+
+    <div class="note"><h3>Trailing Slash</h3>
+      This directive applies to requests for directories that may or may 
+      not end in a trailing slash, so expressions that are anchored to the 
+      end of line ($) must be written with care.
+    </div>
+
 <h3>See also</h3>
 <ul>
 <li><code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> for
index 820d9146c1a7e3678cd073a9e24149d2a9fe4f28..4165dbd87f317c299eded2afdf1668159736f245 100644 (file)
@@ -698,11 +698,10 @@ subdirectories</description>
 <usage>
     <p><directive type="section">DirectoryMatch</directive> and
     <code>&lt;/DirectoryMatch&gt;</code> are used to enclose a group
-    of directives which will apply only to the named directory and
-    sub-directories of that directory, the same as <directive
-    module="core" type="section">Directory</directive>. However, it
-    takes as an argument a <glossary ref="regex">regular 
-    expression</glossary>. For example:</p>
+    of directives which will apply only to the named directory, 
+    the same as <directive module="core" type="section">Directory</directive>. 
+    However, it takes as an argument a 
+    <glossary ref="regex">regular expression</glossary>.  For example:</p>
 
     <example>
       &lt;DirectoryMatch "^/www/(.+/)?[0-9]{3}"&gt;
@@ -710,6 +709,20 @@ subdirectories</description>
 
     <p>would match directories in <code>/www/</code> that consisted of three
     numbers.</p>
+
+   <note><title>Compatability</title>
+      Prior to 2.3.9, this directive implicitly applied to sub-directories
+      (like <directive module="core" type="section">Directory</directive>) and
+      could not match the end of line symbol ($).  In 2.3.9 and later,
+      only directories that match the expression are affected by the enclosed
+      directives.
+    </note>
+
+    <note><title>Trailing Slash</title>
+      This directive applies to requests for directories that may or may 
+      not end in a trailing slash, so expressions that are anchored to the 
+      end of line ($) must be written with care.
+    </note>
 </usage>
 <seealso><directive type="section" module="core">Directory</directive> for
 a description of how regular expressions are mixed in with normal
index a5fbcde9982a20ea274765b163cf20e5dbfe814d..612b09eb2f95871c8e2ea8140e73a82bd5eba1b7 100644 (file)
@@ -1169,7 +1169,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
                 continue;
             }
 
-            if (ap_regexec(entry_core->r, r->filename, 0, NULL, AP_REG_NOTEOL)) {
+            if (ap_regexec(entry_core->r, r->filename, 0, NULL, 0)) {
                 continue;
             }