You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by co...@apache.org on 2010/08/27 12:46:03 UTC

svn commit: r990091 - in /httpd/httpd/trunk: CHANGES docs/manual/mod/core.html.en docs/manual/mod/core.xml server/request.c

Author: covener
Date: Fri Aug 27 10:46:02 2010
New Revision: 990091

URL: http://svn.apache.org/viewvc?rev=990091&view=rev
Log:
PR49809: Allow DirectoryMatch to match the EOL character ($). and
stop applying to subdirectories (that don't also match the regex) implicitly.  

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


Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/manual/mod/core.html.en
    httpd/httpd/trunk/docs/manual/mod/core.xml
    httpd/httpd/trunk/server/request.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=990091&r1=990090&r2=990091&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Aug 27 10:46:02 2010
@@ -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
 

Modified: httpd/httpd/trunk/docs/manual/mod/core.html.en
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.html.en?rev=990091&r1=990090&r2=990091&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.html.en (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.html.en Fri Aug 27 10:46:02 2010
@@ -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

Modified: httpd/httpd/trunk/docs/manual/mod/core.xml
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/core.xml?rev=990091&r1=990090&r2=990091&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/core.xml (original)
+++ httpd/httpd/trunk/docs/manual/mod/core.xml Fri Aug 27 10:46:02 2010
@@ -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

Modified: httpd/httpd/trunk/server/request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/request.c?rev=990091&r1=990090&r2=990091&view=diff
==============================================================================
--- httpd/httpd/trunk/server/request.c (original)
+++ httpd/httpd/trunk/server/request.c Fri Aug 27 10:46:02 2010
@@ -1169,7 +1169,7 @@ AP_DECLARE(int) ap_directory_walk(reques
                 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;
             }