]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 4966: Lower cache_peer hostname (#420)
authoruhliarik <luhliari@redhat.com>
Mon, 15 Jul 2019 03:42:39 +0000 (03:42 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Mon, 15 Jul 2019 03:42:44 +0000 (03:42 +0000)
When parsing entries from /etc/hosts file, they are all lowered
(see bug 3040). If cache_peer hostname is uppercase, it will
lead to DNS resolution failure. Lowering cache_peer host fixes
this issue.

This change may expose broken Squid configurations that
incorrectly relied on non-lowercase peer host names to
bypass Squid's "is this cache_peer different from me?"
check. Though such configurations should encounter
forwarding loop errors later anyway.

src/cache_cf.cc

index ff1b0e683372d6c94d7033b95ef806907b98955c..4ef581279b703b2b45fcd2f4d6757c68cfe47386 100644 (file)
@@ -2139,6 +2139,7 @@ parse_peer(CachePeer ** head)
 
     CachePeer *p = new CachePeer;
     p->host = xstrdup(host_str);
+    Tolower(p->host);
     p->name = xstrdup(host_str);
     p->type = parseNeighborType(token);