]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
DEVEL15-windows-afsd-list-acl-only-dir-20070515
authorJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 16 May 2007 04:44:44 +0000 (04:44 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Wed, 16 May 2007 04:44:44 +0000 (04:44 +0000)
FIXES 60258

When the ACL on a directory is list only, attempts to read the status
of items in the directory will fail.  Therefore, it is pointless to try.
Instead, when we know the user ACL does not have read permission, we
should immediately lie about the status info.  That way we don't pound
the file server with requests that will produce an abort which in turn
will trigger force the file server to delay responses to the client.

This change has the added benefit that cached status info is no longer
leaked to callers that do not have appropriate permissions.

With this change the Explorer Shell is much more responsive.

(cherry picked from commit e02fa3e73b258938135244f7e3c09baa464e0c26)

src/WINNT/afsd/smb3.c

index 7f1f5fe61d8611c6fd6f6e7c112cdd63f2dc0d76..40ec07b19afa47bdf3681bd612b9c06768852c0f 100644 (file)
@@ -3654,14 +3654,29 @@ smb_ApplyV3DirListPatches(cm_scache_t *dscp,
     unsigned long lattr;
     smb_dirListPatch_t *patchp;
     smb_dirListPatch_t *npatchp;
-        
+    afs_uint32 rights;
+
+    code = cm_FindACLCache(dscp, userp, &rights);
+    if (code == 0 && !(rights & PRSFS_READ))
+        code = CM_ERROR_NOACCESS;
+    else if (code == -1) {
+        lock_ObtainMutex(&dscp->mx);
+        code = cm_SyncOp(dscp, NULL, userp, reqp, PRSFS_READ,
+                          CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
+        lock_ReleaseMutex(&dscp->mx);
+    }
+    if (code)
+        return code;
+
     for(patchp = *dirPatchespp; patchp; patchp =
          (smb_dirListPatch_t *) osi_QNext(&patchp->q)) {
-               code = cm_GetSCache(&patchp->fid, &scp, userp, reqp);
-        if (code) continue;
+        code = cm_GetSCache(&patchp->fid, &scp, userp, reqp);
+        if (code) 
+            continue;
+
         lock_ObtainMutex(&scp->mx);
         code = cm_SyncOp(scp, NULL, userp, reqp, 0,
-                          CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
+                         CM_SCACHESYNC_NEEDCALLBACK | CM_SCACHESYNC_GETSTATUS);
         if (code) { 
             lock_ReleaseMutex(&scp->mx);
             cm_ReleaseSCache(scp);