From: Amos Jeffries Date: Sat, 23 Oct 2010 14:29:42 +0000 (-0600) Subject: Bug 3040: Lower-case domain entries from hosts and resolv.conf files X-Git-Tag: SQUID_3_1_9~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b64263aa7dc5674f32a187a1d8c9efa689c13534;p=thirdparty%2Fsquid.git Bug 3040: Lower-case domain entries from hosts and resolv.conf files --- 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; }