Windows: propagate directory enumeration failures
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 16 Dec 2011 16:43:32 +0000 (11:43 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sat, 17 Dec 2011 05:21:43 +0000 (21:21 -0800)
If a directory is enumerated with an AuthGroup that has no
permissions, do not treat the enumeration as successful.

Change-Id: I6a543a1b19b9d2e68ee2c99f67398ed94ad52896
Reviewed-on: http://gerrit.openafs.org/6344
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp

index 4146ced..cd8dffd 100644 (file)
@@ -2898,10 +2898,16 @@ AFSVerifyEntry( IN GUID *AuthGroup,
                     AFSAcquireExcl( pObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock,
                                     TRUE);
 
-                    AFSValidateDirectoryCache( pObjectInfo,
-                                               AuthGroup);
+                    ntStatus = AFSValidateDirectoryCache( pObjectInfo,
+                                                          AuthGroup);
 
                     AFSReleaseResource( pObjectInfo->Specific.Directory.DirectoryNodeHdr.TreeLock);
+
+                    if ( !NT_SUCCESS( ntStatus))
+                    {
+
+                        try_return( ntStatus);
+                    }
                 }
 
                 //
@@ -3323,8 +3329,13 @@ AFSValidateDirectoryCache( IN AFSObjectInfoCB *ObjectInfo,
         // Reget the directory contents
         //
 
-        AFSVerifyDirectoryContent( ObjectInfo,
-                                   AuthGroup);
+        ntStatus = AFSVerifyDirectoryContent( ObjectInfo,
+                                              AuthGroup);
+
+        if ( !NT_SUCCESS( ntStatus))
+        {
+            try_return( ntStatus);
+        }
 
         //
         // Now start again and tear down any entries not valid
@@ -3439,6 +3450,8 @@ AFSValidateDirectoryCache( IN AFSObjectInfoCB *ObjectInfo,
         }
 #endif
 
+try_exit:
+
         if( bAcquiredLock)
         {