]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sat, 3 Aug 2019 06:34:33 +0000 (18:34 +1200)
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 9165ef99c1c64e1d55a7100dbee6a225ede96386..32a3df322be6c61e252a7bb7a4a65e0f5e85bbfe 100644 (file)
@@ -2081,6 +2081,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);