From b64263aa7dc5674f32a187a1d8c9efa689c13534 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 23 Oct 2010 08:29:42 -0600 Subject: [PATCH] Bug 3040: Lower-case domain entries from hosts and resolv.conf files --- src/dns_internal.cc | 3 ++- src/fqdncache.cc | 1 + src/ipcache.cc | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dns_internal.cc b/src/dns_internal.cc index 7557b0b14e..f3930df8ea 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -43,7 +43,7 @@ #include "fde.h" #include "ip/tools.h" #include "MemBuf.h" - +#include "util.h" #include "wordlist.h" #if HAVE_ARPA_NAMESER_H @@ -258,6 +258,7 @@ idnsAddPathComponent(const char *buf) assert(npc < npc_alloc); strcpy(searchpath[npc].domain, buf); + Tolower(searchpath[npc].domain); debugs(78, 3, "idnsAddPathComponent: Added domain #" << npc << ": " << searchpath[npc].domain); npc++; } diff --git a/src/fqdncache.cc b/src/fqdncache.cc index ab2699e2ab..f0744c4621 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -858,6 +858,7 @@ fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames) while (hostnames) { fce->names[j] = xstrdup(hostnames->key); + Tolower(fce->names[j]); j++; hostnames = hostnames->next; diff --git a/src/ipcache.cc b/src/ipcache.cc index 9a45d6f01d..bd1a210fa7 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -295,6 +295,7 @@ ipcacheCreateEntry(const char *name) static ipcache_entry *i; i = (ipcache_entry *)memAllocate(MEM_IPCACHE_ENTRY); i->hash.key = xstrdup(name); + Tolower(static_cast(i->hash.key)); i->expires = squid_curtime + Config.negativeDnsTtl; return i; } -- 2.47.2