From 170bbbdb93df64d3657026e13aba26c40d93f51d Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sat, 16 Mar 2013 01:15:01 -0400 Subject: [PATCH] Windows: netbios name comparisons are case insensitive When parsing the symlink target string to categorize it as AFS Symlink or DFS Link, the comparison with the netbios name string must be case insensitive. Otherwise, symlinks are reported to the redirector as DFS Links. For the most part they will work since the AFS redirector requesting MUP to Reparse the \\AFS path will call back into the AFS redirector. However, the attributes on symlinks to files will be wrong as DFS Links can only be links to directories. Change-Id: Ia9652991549b0783f7a534b071ff99ceabdd3382 Reviewed-on: http://gerrit.openafs.org/9612 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/user/RDRFunction.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/WINNT/afsrdr/user/RDRFunction.c b/src/WINNT/afsrdr/user/RDRFunction.c index 7d86f5c00..d565eefb1 100644 --- a/src/WINNT/afsrdr/user/RDRFunction.c +++ b/src/WINNT/afsrdr/user/RDRFunction.c @@ -676,7 +676,7 @@ RDR_PopulateCurrentEntry( IN AFSDirEnumEntry * pCurrentEntry, } else if (mp[offset] == '\\') { size_t nbNameLen = strlen(cm_NetbiosName); - if ( strncmp(&mp[offset + 1], cm_NetbiosName, nbNameLen) == 0 && + if ( strnicmp(&mp[offset + 1], cm_NetbiosName, nbNameLen) == 0 && mp[offset + nbNameLen + 1] == '\\') { /* an AFS symlink */ @@ -691,7 +691,7 @@ RDR_PopulateCurrentEntry( IN AFSDirEnumEntry * pCurrentEntry, mbstowcs(wtarget, &mp[offset], wtarget_len); #endif } else if ( mp[offset + 1] == '\\' && - strncmp(&mp[offset + 2], cm_NetbiosName, strlen(cm_NetbiosName)) == 0 && + strnicmp(&mp[offset + 2], cm_NetbiosName, strlen(cm_NetbiosName)) == 0 && mp[offset + nbNameLen + 2] == '\\') { /* an AFS symlink */ -- 2.39.5