You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2009/06/19 08:54:37 UTC

DO NOT REPLY [Bug 47392] New: is using the wrong directory

https://issues.apache.org/bugzilla/show_bug.cgi?id=47392

           Summary: <FilesMatch> is using the wrong directory
           Product: Apache httpd-2
           Version: 2.2.11
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: sworddragon2@aol.com


The <FilesMatch> directive is using the superior directory if the access
through the URL is without a / at the end. Here is an example for better
understanding:

I created in the htdocs directory a new directory and named it test. In this
directory have i created a .htaccess with the content:

Allow from all
<FilesMatch ^test>
Deny from all
</FilesMatch>

And there are two empty files named test.php and another_file.php. Now the
following happens:

http://localhost/test -> Error 403 forbidden
http://localhost/test/ -> Access is allowed and i can see the index
http://localhost/test/test.php -> Error 403 forbidden
http://localhost/test/another_file.php -> Access is allowed

The problem is, that ^test matches of the superior directory if there is no /
at the end of the URL and the access is denied. If i delete the .htaccess the
following happens:

http://localhost/test -> Switches to http://localhost/test/ and the i can see
the index
http://localhost/test/ -> Access is allowed and i can see the index
http://localhost/test/test.php -> Access is allowed
http://localhost/test/another_file.php -> Access is allowed

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47392] is using the wrong directory

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47392


Dan Poirier <po...@pobox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




--- Comment #1 from Dan Poirier <po...@pobox.com>  2009-06-19 05:08:49 PST ---
Good detailed problem description, but in the wrong place.  Please ask
configuration questions on the user's list, don't open bug reports.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47392] is using the wrong directory

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47392


Dan Poirier <po...@pobox.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|                            |INVALID




--- Comment #3 from Dan Poirier <po...@pobox.com>  2009-06-26 07:05:14 PST ---
If you don't think the server is behaving the way you expect it to, you should
always ask about it on the users list.  Maybe someone will say "yes, that's a
bug, please open a bug report" but it's much more likely that someone will
explain to you how to configure the server to behave the way you want.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47392] is using the wrong directory

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47392


sworddragon2@aol.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




--- Comment #2 from sworddragon2@aol.com  2009-06-26 05:36:14 PST ---
I have already read the following documentation:
http://httpd.apache.org/docs/2.2/mod/core.html

There is nothing what explains this behavior. Just try to make a solution with
my example. If this is really a bug, nobody can resolve this without a bugfix.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47392] is using the wrong directory

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47392





--- Comment #5 from Nick Kew <ni...@webthing.com>  2009-06-26 09:11:35 PST ---
FWIW, I took a look this afternoon.  This report needs to move to users@ so we
can diagnose the OP's real problem, but playing with a .htaccess showed up a
more serious bug.  I need to poke about a bit more before reporting/fixing it.

I guess none of the devs tend to use .htaccess ...

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 47392] is using the wrong directory

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47392





--- Comment #6 from Nick Kew <ni...@webthing.com>  2009-06-26 09:26:50 PST ---
(In reply to comment #5)
> FWIW, I took a look this afternoon.  This report needs to move to users@ so we
> can diagnose the OP's real problem, but playing with a .htaccess showed up a
> more serious bug.  I need to poke about a bit more before reporting/fixing it.

I take that back: my issue was a <Location /> overriding the .htaccess (I blame
the heat).  I can confirm the behaviour reported by the OP.

Still thinking about it.  The least we should do is document more clearly some
of the counter-intuitive things that happen on a merge.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Re: DO NOT REPLY [Bug 47392] is using the wrong directory

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
This is a discussion not a bugfix (yet) :)

bugzilla@apache.org wrote:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=47392
> 
> --- Comment #4 from Eric Covener <co...@gmail.com>  2009-06-26 08:26:45 PST ---
> re-opening for some more eyes.
> 
> Requesting a directory e.g. "/test" without a trailing slash, ap_file_walk
> applies Files/Filesmatch containers to the "basename" (/test->test)  that live
> in  /test/.htaccess
> 
> Is this as desired or should it be short-circuited (skipped, treated as an
> empty iflename, ???) if we have the above case?  Sounds like a candidate for
> trunk-only change.

I suggest we leave as is; you know this is a container, but how do you know
/test is not /test/ container when looking at a proxy server?  You might hit
a directory match relative to docroot, but if it's served from the backend
proxy server, /test may be a resource.

IMHO, don't mess with the existing behavior; my 2c US, still dwindling.

DO NOT REPLY [Bug 47392] is using the wrong directory

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=47392


Eric Covener <co...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |




--- Comment #4 from Eric Covener <co...@gmail.com>  2009-06-26 08:26:45 PST ---
re-opening for some more eyes.

Requesting a directory e.g. "/test" without a trailing slash, ap_file_walk
applies Files/Filesmatch containers to the "basename" (/test->test)  that live
in  /test/.htaccess

Is this as desired or should it be short-circuited (skipped, treated as an
empty iflename, ???) if we have the above case?  Sounds like a candidate for
trunk-only change.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org