]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
backport of 1893519,1893532 from trunk:
authorStefan Eissing <icing@apache.org>
Thu, 23 Sep 2021 12:31:53 +0000 (12:31 +0000)
committerStefan Eissing <icing@apache.org>
Thu, 23 Sep 2021 12:31:53 +0000 (12:31 +0000)
  *) mod_proxy: Handle UDS URIs with empty hostname ("unix:///...") as if they
     had no hostname ("unix:/..."), also in mod_rewrite's is_absolulte_uri().

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

changes-entries/uds_empty_hostname.txt [new file with mode: 0644]
modules/mappers/mod_rewrite.c
modules/proxy/proxy_util.c

diff --git a/changes-entries/uds_empty_hostname.txt b/changes-entries/uds_empty_hostname.txt
new file mode 100644 (file)
index 0000000..beff302
--- /dev/null
@@ -0,0 +1,2 @@
+  *) mod_proxy: Handle UDS URIs with empty hostname ("unix:///...") as if they
+     had no hostname ("unix:/...").  [Yann Ylavic]
\ No newline at end of file
index 8adc92c7253fa8b4ce2f37e7b1a812d90f56c804..80fbc9e84ff3c09fd4b2a8909e68d4cfe30bceb6 100644 (file)
@@ -622,7 +622,7 @@ static unsigned is_absolute_uri(char *uri, int *supportsqs)
     case 'U':
         if (!ap_cstr_casecmpn(uri, "nix:", 4)) {        /* unix:     */
             *sqs = 1;
-            return 5;
+            return (uri[4] == '/' && uri[5] == '/') ? 7 : 5;
         }
     }
 
index 00ae50fce4249cafea1de055046c76f6574e3aad..f291a0d55f2274950996e8fd44b8cec440c7a4a7 100644 (file)
@@ -2291,7 +2291,8 @@ static int fix_uds_filename(request_rec *r, char **url)
         rv = apr_uri_parse(r->pool, uds_url, &urisock);
         *origin_url++ = '|';
 
-        if (rv == APR_SUCCESS && urisock.path && !urisock.hostname) {
+        if (rv == APR_SUCCESS && urisock.path && (!urisock.hostname
+                                                  || !urisock.hostname[0])) {
             uds_path = ap_runtime_dir_relative(r->pool, urisock.path);
         }
         if (!uds_path) {