From baa883aa6b878abe808d302d14142f702dfb9cca Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 2 Sep 2009 22:44:33 -0400 Subject: [PATCH] Windows: avoid inappropriate dns searches 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 Reviewed-by: Asanka Herath Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- src/WINNT/afsd/cm_config.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsd/cm_config.c b/src/WINNT/afsd/cm_config.c index e525a1790..b54216c75 100644 --- a/src/WINNT/afsd/cm_config.c +++ b/src/WINNT/afsd/cm_config.c @@ -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); -- 2.39.5