e6ac7e
From d3527ec67a9ddad9c189ae360d4f6181d5413bfa Mon Sep 17 00:00:00 2001
e6ac7e
From: uhliarik <luhliari@redhat.com>
e6ac7e
Date: Mon, 15 Jul 2019 03:42:39 +0000
e6ac7e
Subject: [PATCH] Bug 4966: Lower cache_peer hostname (#420)
e6ac7e
e6ac7e
When parsing entries from /etc/hosts file, they are all lowered
e6ac7e
(see bug 3040). If cache_peer hostname is uppercase, it will
e6ac7e
lead to DNS resolution failure. Lowering cache_peer host fixes
e6ac7e
this issue.
e6ac7e
e6ac7e
This change may expose broken Squid configurations that
e6ac7e
incorrectly relied on non-lowercase peer host names to
e6ac7e
bypass Squid's "is this cache_peer different from me?"
e6ac7e
check. Though such configurations should encounter
e6ac7e
forwarding loop errors later anyway.
e6ac7e
---
e6ac7e
 src/cache_cf.cc | 1 +
e6ac7e
 1 file changed, 1 insertion(+)
e6ac7e
e6ac7e
diff --git a/src/cache_cf.cc b/src/cache_cf.cc
e6ac7e
index 8886b68..e6b231c 100644
e6ac7e
--- a/src/cache_cf.cc
e6ac7e
+++ b/src/cache_cf.cc
e6ac7e
@@ -2075,7 +2075,7 @@ parse_peer(CachePeer ** head)
e6ac7e
         self_destruct();
e6ac7e
 
e6ac7e
     p->host = xstrdup(token);
e6ac7e
-
e6ac7e
+    Tolower(p->host);
e6ac7e
     p->name = xstrdup(token);
e6ac7e
 
e6ac7e
     if ((token = ConfigParser::NextToken()) == NULL)