You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2024/07/27 13:54:09 UTC

svn commit: r1919547 - /httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c

Author: ylavic
Date: Sat Jul 27 13:54:08 2024
New Revision: 1919547

URL: http://svn.apache.org/viewvc?rev=1919547&view=rev
Log:
mod_proxy_fcgi: Use r->uri rather than r->filename for directory walk.

r->filename is a "proxy:" one for mod_proxy modules, and ap_directory_walk()
can't cope with that, so force r->uri.

Github: closes #468


Modified:
    httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c?rev=1919547&r1=1919546&r2=1919547&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c Sat Jul 27 13:54:08 2024
@@ -133,7 +133,6 @@ static int proxy_fcgi_canon(request_rec
         /* It has to be on disk for this to work */
         if (!strcasecmp(pathinfo_type, "full")) {
             rconf->need_dirwalk = 1;
-            ap_unescape_url_keep2f(path, 0);
         }
         else if (!strcasecmp(pathinfo_type, "first-dot")) {
             char *split = ap_strchr(path, '.');
@@ -348,10 +347,11 @@ static apr_status_t send_environment(pro
     fcgi_req_config_t *rconf = ap_get_module_config(r->request_config, &proxy_fcgi_module);
     fcgi_dirconf_t *dconf = ap_get_module_config(r->per_dir_config, &proxy_fcgi_module);
 
-    if (rconf) {
-       if (rconf->need_dirwalk) {
-          ap_directory_walk(r);
-       }
+    if (rconf && rconf->need_dirwalk) {
+        char *saved_filename = r->filename;
+        r->filename = r->uri;
+        ap_directory_walk(r);
+        r->filename = saved_filename;
     }
 
     /* Strip proxy: prefixes */



Re: svn commit: r1919547 - /httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c

Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, Aug 8, 2024 at 11:45 AM Ruediger Pluem <rp...@apache.org> wrote:
>
> On 7/27/24 3:54 PM, ylavic@apache.org wrote:
> >
> > --- httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c (original)
> > +++ httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c Sat Jul 27 13:54:08 2024
> > @@ -133,7 +133,6 @@ static int proxy_fcgi_canon(request_rec
> >          /* It has to be on disk for this to work */
> >          if (!strcasecmp(pathinfo_type, "full")) {
> >              rconf->need_dirwalk = 1;
> > -            ap_unescape_url_keep2f(path, 0);
> >          }
> >          else if (!strcasecmp(pathinfo_type, "first-dot")) {
> >              char *split = ap_strchr(path, '.');
> > @@ -348,10 +347,11 @@ static apr_status_t send_environment(pro
> >      fcgi_req_config_t *rconf = ap_get_module_config(r->request_config, &proxy_fcgi_module);
> >      fcgi_dirconf_t *dconf = ap_get_module_config(r->per_dir_config, &proxy_fcgi_module);
> >
> > -    if (rconf) {
> > -       if (rconf->need_dirwalk) {
> > -          ap_directory_walk(r);
> > -       }
> > +    if (rconf && rconf->need_dirwalk) {
> > +        char *saved_filename = r->filename;
> > +        r->filename = r->uri;
>
> Why not using the result of the below Strip proxy: prefixes for r->filename? In case of a Rewriterule I guess r->uri and
> r->filename could be fundamentally different path wise.

Did this in r1921238, as well as setting up the expected request
fields for ap_directory_walk().

Regards;
Yann.

Re: svn commit: r1919547 - /httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 7/27/24 3:54 PM, ylavic@apache.org wrote:
> Author: ylavic
> Date: Sat Jul 27 13:54:08 2024
> New Revision: 1919547
> 
> URL: http://svn.apache.org/viewvc?rev=1919547&view=rev
> Log:
> mod_proxy_fcgi: Use r->uri rather than r->filename for directory walk.
> 
> r->filename is a "proxy:" one for mod_proxy modules, and ap_directory_walk()
> can't cope with that, so force r->uri.
> 
> Github: closes #468
> 
> 
> Modified:
>     httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c
> 
> Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c?rev=1919547&r1=1919546&r2=1919547&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c (original)
> +++ httpd/httpd/trunk/modules/proxy/mod_proxy_fcgi.c Sat Jul 27 13:54:08 2024
> @@ -133,7 +133,6 @@ static int proxy_fcgi_canon(request_rec
>          /* It has to be on disk for this to work */
>          if (!strcasecmp(pathinfo_type, "full")) {
>              rconf->need_dirwalk = 1;
> -            ap_unescape_url_keep2f(path, 0);
>          }
>          else if (!strcasecmp(pathinfo_type, "first-dot")) {
>              char *split = ap_strchr(path, '.');
> @@ -348,10 +347,11 @@ static apr_status_t send_environment(pro
>      fcgi_req_config_t *rconf = ap_get_module_config(r->request_config, &proxy_fcgi_module);
>      fcgi_dirconf_t *dconf = ap_get_module_config(r->per_dir_config, &proxy_fcgi_module);
>  
> -    if (rconf) {
> -       if (rconf->need_dirwalk) {
> -          ap_directory_walk(r);
> -       }
> +    if (rconf && rconf->need_dirwalk) {
> +        char *saved_filename = r->filename;
> +        r->filename = r->uri;

Why not using the result of the below Strip proxy: prefixes for r->filename? In case of a Rewriterule I guess r->uri and
r->filename could be fundamentally different path wise.

Regards

Rüdiger