Windows: EvaluateByName support case-insensitive lookups
authorJeffrey Altman <jaltman@your-file-system.com>
Tue, 19 Feb 2013 02:26:23 +0000 (21:26 -0500)
committerJeffrey Altman <jaltman@your-file-system.com>
Fri, 22 Feb 2013 21:22:43 +0000 (13:22 -0800)
Directory lookups in AFS should favor case-sensivite matches
but permit case-insensitive matches otherwise.  The service
should not follow mount points.  The redirector exposes mount
points as junctions.

Change-Id: I34c9244e2756a926f29bbf184dc250e7a29d264f
Reviewed-on: http://gerrit.openafs.org/9132
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>

src/WINNT/afsrdr/user/RDRFunction.c

index a32cac3..34dcef2 100644 (file)
@@ -1092,7 +1092,15 @@ RDR_EvaluateNodeByName( IN cm_user_t *userp,
         return;
     }
 
-    code = cm_Lookup(dscp, wszName, CM_FLAG_CHECKPATH, userp, &req, &scp);
+    code = cm_Lookup(dscp, wszName, CM_FLAG_CHECKPATH | CM_FLAG_NOMOUNTCHASE,
+                     userp, &req, &scp);
+
+    if (!CaseSensitive &&
+        (code == CM_ERROR_NOSUCHPATH || code == CM_ERROR_NOSUCHFILE || code == CM_ERROR_BPLUS_NOMATCH)) {
+        code = cm_Lookup(dscp, wszName,
+                         CM_FLAG_CHECKPATH | CM_FLAG_NOMOUNTCHASE | CM_FLAG_CASEFOLD,
+                         userp, &req, &scp);
+    }
 
     if ((code == CM_ERROR_NOSUCHPATH || code == CM_ERROR_NOSUCHFILE || code == CM_ERROR_BPLUS_NOMATCH) &&
          dscp == cm_data.rootSCachep) {