[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-docs
Subject:    [Bug 65057] New: ambiguities in <DirectoryMatch>
From:       bugzilla () apache ! org
Date:       2021-01-05 2:54:53
Message-ID: bug-65057-56585 () https ! bz ! apache ! org/bugzilla/
[Download RAW message or body]

https://bz.apache.org/bugzilla/show_bug.cgi?id=65057

            Bug ID: 65057
           Summary: ambiguities in <DirectoryMatch>
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
          Assignee: docs@httpd.apache.org
          Reporter: calestyo@scientia.net
  Target Milestone: ---

In at least mod/core.html's documentation of <DirectoryMatch> (probably
<FileMatch> <LocationMatch>, too):

1) "<DirectoryMatch> and </DirectoryMatch> are used to enclose a group of
directives which will apply only to the named directory (and the files within),
the same as <Directory>."

Well since 2.3.9. exactly this is NO LONGER the case, the sentence should be
improved to e.g.
"<DirectoryMatch> and </DirectoryMatch> are used to enclose a group of
directives which will apply to matching directories (and the (non-directory)
files within) only."

Perhaps adding one like:
"Unlike with (the non regular-experession version of) <Directory> they don't
apply to any subdirectories, unless these are matched by the regular
expression, too."


2) Also it's not really clear whether and how any implicit anchoring is done to
^ and ?,... i.e. to which of the following regexps is <DirectoryMatch
"/var/www"> effectively identical to:
/var/www => would also match /usr/var/www or /usr/var/wwwbar 
^/var/www => would also match /usr/var/wwwbar or /usr/var/www/bar 
^/var/www/ => would also match any subdirs thereof

or is it what's expected:
^/var/www$
^/var/www/$
i.e. only the directory itself.


Depending on which it is, the documentation's example using
"^/www/(.+/)?[0-9]{3}/" might be wrong too, as this has no explicit $ anchor
and would thus also match /www/something/999/andEvenMore



3) At least to me, the following is not clear:
"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."

I mean for <Location> I'd understand cause there "/foo" is something different
than "/foo/", but for file system directories it's the same if it's a
directory.

So from my understanding:
^/var/www$
^/var/www/$
should be the very same if I want to match only /var/www and no subdirs, while
e.g.
^/var/www => would match anything where the 2nd lvl starts with www
^/var/www/ => would match /var/www and any of it's subdirs


Cheers,
Chris.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic