From: Stefan Eissing Date: Thu, 23 Sep 2021 12:31:53 +0000 (+0000) Subject: backport of 1893519,1893532 from trunk: X-Git-Tag: candidate-2.4.50-rc1~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81a8b0133b46c4cf7dfc4b5476ad46eb34aa0a5c;p=thirdparty%2Fapache%2Fhttpd.git backport of 1893519,1893532 from trunk: *) 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 --- diff --git a/changes-entries/uds_empty_hostname.txt b/changes-entries/uds_empty_hostname.txt new file mode 100644 index 00000000000..beff3023e90 --- /dev/null +++ b/changes-entries/uds_empty_hostname.txt @@ -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 diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 8adc92c7253..80fbc9e84ff 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -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; } } diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 00ae50fce42..f291a0d55f2 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -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) {