]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1751970 from trunk:
authorJim Jagielski <jim@apache.org>
Wed, 3 Aug 2016 11:49:43 +0000 (11:49 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 3 Aug 2016 11:49:43 +0000 (11:49 +0000)
PR59815: rewrite per-directory + fcgi broken in 2.4.23

remove the query string from r->filename before calculating environment
(SCRIPT_FILENAME) in mod_proxy_fcgi.  Before PR59618, php-fpm would
see proxy:fcgi:// and do some of this same stripping.

Submitted by: covener
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1755077 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/proxy/mod_proxy_fcgi.c

diff --git a/CHANGES b/CHANGES
index 6dac76e4f17e02903b548dcc2c3ba1c1e9d32ee0..8cd8e86bbb296ce0051b47b9fbd060c8e12dd6d3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.24
 
+  *) mod_proxy_fcgi: Fix 2.4.23 breakage for mod_rewrite per-dir and query 
+     string showing up in SCRIPT_FILENAME. PR59815
+
   *) mod_include: Fix a potential memory misuse while evaluating expressions.
      PR59844. [Eric Covener]
 
diff --git a/STATUS b/STATUS
index 9dcfb5bea34f165d305dcda830aa7efb6b2bd930..89dab2c2f103ea6e8a6f418557f923210545fefa 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -124,12 +124,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_proxy_fcgi: Fix 2.4.23 breakage for mod_rewrite per-dir and query 
-     string showing up in SCRIPT_FILENAME. PR59815
-     trunk patch:  http://svn.apache.org/r1751970
-     2.4.x patch: trunk works + CHANGES
-     +1 covener, elukey, jim
-
   *) mod_proxy_fdpass: enable at build level 'most', restores compatibility
      with common httpd 2.4 rpm.spec descriptors.
      trunk patch: http://svn.apache.org/r1753224
index 19047ff6e5cbe8e5140890dbcdbf9c293686b536..cad33df9fadb31c6aecf8646183de5bc0992a9eb 100644 (file)
@@ -253,7 +253,6 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
     apr_status_t rv;
     apr_size_t avail_len, len, required_len;
     int next_elem, starting_elem;
-    char *proxyfilename = r->filename;
     fcgi_req_config_t *rconf = ap_get_module_config(r->request_config, &proxy_fcgi_module);
 
     if (rconf) { 
@@ -272,6 +271,13 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
         else if (!strncmp(r->filename, "proxy:fcgi://", 13)) {
             newfname = apr_pstrdup(r->pool, r->filename+13);
         }
+        /* Query string in environment only */
+        if (newfname && r->args && *r->args) { 
+            char *qs = strrchr(newfname, '?');
+            if (qs && !strcmp(qs+1, r->args)) { 
+                *qs = '\0';
+            }
+        }
 
         if (newfname) {
             newfname = ap_strchr(newfname, '/');
@@ -282,8 +288,6 @@ static apr_status_t send_environment(proxy_conn_rec *conn, request_rec *r,
     ap_add_common_vars(r);
     ap_add_cgi_vars(r);
  
-    r->filename = proxyfilename;
-
     /* XXX are there any FastCGI specific env vars we need to send? */
 
     /* XXX mod_cgi/mod_cgid use ap_create_environment here, which fills in