]> 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>
Wed, 20 Oct 2010 01:32:49 +0000 (19:32 -0600)
committerAmos Jeffries <amosjeffries@squid-cache.org>
Wed, 20 Oct 2010 01:32:49 +0000 (19:32 -0600)
src/dns_internal.cc
src/fqdncache.cc
src/ipcache.cc

index 3475582907ba62b61f2d12cb4f3b6d2d92fe4bf8..7fd523551505a60d28fee20d587a0c468cdefe26 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
@@ -312,6 +312,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 d8c9e7d8690c6c3e927208f5cba4433ac1e945d5..f00da301d6c9e5eeeded7f02aaca4434651076b1 100644 (file)
@@ -850,6 +850,7 @@ fqdncacheAddEntryFromHosts(char *addr, wordlist * hostnames)
 
     while (hostnames) {
         fce->names[j] = xstrdup(hostnames->key);
+        Tolower(fce->names[j]);
         j++;
         hostnames = hostnames->next;
 
index 20f1b3d3c51c978a23793ad98d4955e05f878bfa..de31059a962484a7c269fdb50b24cc3ddae1ce53 100644 (file)
@@ -293,6 +293,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;
 }