From: Jeffrey Altman Date: Sat, 16 Mar 2013 05:15:01 +0000 (-0400) Subject: Windows: netbios name comparisons are case insensitive X-Git-Tag: upstream/1.8.0_pre1^2~1293 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=170bbbdb93df64d3657026e13aba26c40d93f51d;p=packages%2Fo%2Fopenafs.git 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 --- 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 */