Windows: avoid inappropriate dns searches
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 3 Sep 2009 02:44:33 +0000 (22:44 -0400)
committerJeffrey Altman <jaltman|account-1000011@unknown>
Thu, 3 Sep 2009 13:28:08 +0000 (06:28 -0700)
Do not perform searches for cells if the string prefix
matches _._AFS_IOCTL_._.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/394
Tested-by: Asanka Herath <asanka@secure-endpoints.com>
Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_config.c

index e525a17..b54216c 100644 (file)
@@ -92,6 +92,7 @@ IsWindowsModule(const char * name)
     }
     p = strrchr(name, '.');
     if (p) {
+        /* as of 2009-09-04 these are not valid ICANN ccTLDs */
        if (i == 1 && 
            (!cm_stricmp_utf8N(p,".dll") ||
             !cm_stricmp_utf8N(p,".exe") ||
@@ -693,10 +694,12 @@ long cm_SearchCellByDNS(char *cellNamep, char *newCellNamep, int *ttl,
      * Do not perform a DNS lookup if the name is
      * either a well-known Windows DLL or directory,
      * or if the name does not contain a top-level
-     * domain.
+     * domain, or if the file prefix is the afs pioctl
+     * file name.
      */
     if ( IsWindowsModule(cellNamep) ||
-         cm_FsStrChr(cellNamep, '.') == NULL)
+         cm_FsStrChr(cellNamep, '.') == NULL ||
+         strncasecmp(cellNamep, CM_IOCTL_FILENAME_NOSLASH, strlen(CM_IOCTL_FILENAME_NOSLASH)) == 0)
        return -1;
 
     rc = getAFSServer(cellNamep, cellHostAddrs, cellHostNames, ipRanks, &numServers, ttl);