]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3040: Lower-case domain entries from hosts and resolv.conf files
authorAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 23 Oct 2010 14:29:42 +0000 (08:29 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Sat, 23 Oct 2010 14:29:42 +0000 (08:29 -0600)
src/dns_internal.cc
src/fqdncache.cc
src/ipcache.cc

index 7557b0b14e4a22b5de2a936950af47f6c7058092..f3930df8ea24fcf18aec83e247680601ce27eb32 100644 (file)
@@ -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++;
 }
index ab2699e2abca0f184a729b4f6ac9d3cd857d2067..f0744c46212f8bea7ebfc21ca9aa97193c9e825c 100644 (file)
@@ -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;
 
index 9a45d6f01de95bcfc6185f3e05c3d25daf56c394..bd1a210fa75e567287a4349bb24327f6ae7d88d7 100644 (file)
@@ -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<char*>(i->hash.key));
     i->expires = squid_curtime + Config.negativeDnsTtl;
     return i;
 }