You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by pq...@apache.org on 2005/08/18 22:10:34 UTC

svn commit: r233369 - /httpd/httpd/trunk/modules/mappers/mod_dir.c

Author: pquerna
Date: Thu Aug 18 13:10:26 2005
New Revision: 233369

URL: http://svn.apache.org/viewcvs?rev=233369&view=rev
Log:
Do not check the value of r->handler.

This allows the use of SetHandler for an entire directory, and since we already check via the stat structure if this is a directory, there is no reason for this extra check, which causes a regression since 1.3.

PR: 25435

Modified:
    httpd/httpd/trunk/modules/mappers/mod_dir.c

Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/mappers/mod_dir.c?rev=233369&r1=233368&r2=233369&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_dir.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_dir.c Thu Aug 18 13:10:26 2005
@@ -151,10 +151,6 @@
         return HTTP_MOVED_PERMANENTLY;
     }
 
-    if (strcmp(r->handler, DIR_MAGIC_TYPE)) {
-        return DECLINED;
-    }
-
     if (d->index_names) {
         names_ptr = (char **)d->index_names->elts;
         num_names = d->index_names->nelts;



Re: svn commit: r233369 - /httpd/httpd/trunk/modules/mappers/mod_dir.c

Posted by Paul Querna <ch...@force-elite.com>.
William A. Rowe, Jr. wrote:
> -1.
> 
> If what the PR you fixed wanted to avoid mod_cgi, or the core
> handler dealing with the request, then the correct answer
> was to have those modules reject this request.  Now I expect
> you've just hijacked the request away from tomcat via mod_jk
> among other methods for a module to substitute their own
> directory handling.
> 
> A handler is an explicit reference, and now you have just
> hijacked APR_DIR type files to mod_dir, irrespective of
> the configuration.

How does mod_]
 do this in 1.3, which does not have the check that I just removed?


> Please don't make code changes to make up for sloppy
> configuration changes. 

Excuse me?  This worked perfectly in 1.3.

> Perhaps differentiating SetHandler into SetFileHandler
> and SetDirHandler would be an appropriate solution.
> 
> Bill
> 
> At 03:10 PM 8/18/2005, pquerna@apache.org wrote:
> 
>>Author: pquerna
>>Date: Thu Aug 18 13:10:26 2005
>>New Revision: 233369
>>
>>URL: http://svn.apache.org/viewcvs?rev=233369&view=rev
>>Log:
>>Do not check the value of r->handler.
>>
>>This allows the use of SetHandler for an entire directory, and since we already check via the stat structure if this is a directory, there is no reason for this extra check, which causes a regression since 1.3.
>>
>>PR: 25435
>>
>>Modified:
>>   httpd/httpd/trunk/modules/mappers/mod_dir.c
>>
>>Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c
>>URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/mappers/mod_dir.c?rev=233369&r1=233368&r2=233369&view=diff
>>==============================================================================
>>--- httpd/httpd/trunk/modules/mappers/mod_dir.c (original)
>>+++ httpd/httpd/trunk/modules/mappers/mod_dir.c Thu Aug 18 13:10:26 2005
>>@@ -151,10 +151,6 @@
>>        return HTTP_MOVED_PERMANENTLY;
>>    }
>>
>>-    if (strcmp(r->handler, DIR_MAGIC_TYPE)) {
>>-        return DECLINED;
>>-    }
>>-
>>    if (d->index_names) {
>>        names_ptr = (char **)d->index_names->elts;
>>        num_names = d->index_names->nelts;
> 
> 


Re: svn commit: r233369 - /httpd/httpd/trunk/modules/mappers/mod_dir.c

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
-1.

If what the PR you fixed wanted to avoid mod_cgi, or the core
handler dealing with the request, then the correct answer
was to have those modules reject this request.  Now I expect
you've just hijacked the request away from tomcat via mod_jk
among other methods for a module to substitute their own
directory handling.

A handler is an explicit reference, and now you have just
hijacked APR_DIR type files to mod_dir, irrespective of
the configuration.

Please don't make code changes to make up for sloppy
configuration changes.

Perhaps differentiating SetHandler into SetFileHandler
and SetDirHandler would be an appropriate solution.

Bill

At 03:10 PM 8/18/2005, pquerna@apache.org wrote:
>Author: pquerna
>Date: Thu Aug 18 13:10:26 2005
>New Revision: 233369
>
>URL: http://svn.apache.org/viewcvs?rev=233369&view=rev
>Log:
>Do not check the value of r->handler.
>
>This allows the use of SetHandler for an entire directory, and since we already check via the stat structure if this is a directory, there is no reason for this extra check, which causes a regression since 1.3.
>
>PR: 25435
>
>Modified:
>    httpd/httpd/trunk/modules/mappers/mod_dir.c
>
>Modified: httpd/httpd/trunk/modules/mappers/mod_dir.c
>URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/mappers/mod_dir.c?rev=233369&r1=233368&r2=233369&view=diff
>==============================================================================
>--- httpd/httpd/trunk/modules/mappers/mod_dir.c (original)
>+++ httpd/httpd/trunk/modules/mappers/mod_dir.c Thu Aug 18 13:10:26 2005
>@@ -151,10 +151,6 @@
>         return HTTP_MOVED_PERMANENTLY;
>     }
> 
>-    if (strcmp(r->handler, DIR_MAGIC_TYPE)) {
>-        return DECLINED;
>-    }
>-
>     if (d->index_names) {
>         names_ptr = (char **)d->index_names->elts;
>         num_names = d->index_names->nelts;