Fix bug #6082 - smbd_gpfs_getacl failed: Windows client canĀ“t rename or delete file
[samba.git] / source / lib / util_seaccess.c
index fdc10f20ab62568ba9c2f7eda49ea8a8e18f1752..0da7442d1953748c3e594999748c5c2ce4aea198 100644 (file)
@@ -149,7 +149,9 @@ static uint32_t access_check_max_allowed(const struct security_descriptor *sd,
 }
 
 /*
-  the main entry point for access checking. 
+  The main entry point for access checking. If returning ACCESS_DENIED
+  this function returns the denied bits in the uint32_t pointed
+  to by the access_granted pointer.
 */
 NTSTATUS se_access_check(const struct security_descriptor *sd, 
                          const NT_USER_TOKEN *token,
@@ -238,6 +240,7 @@ NTSTATUS se_access_check(const struct security_descriptor *sd,
 
 done:
        if (bits_remaining != 0) {
+               *access_granted = bits_remaining;
                return NT_STATUS_ACCESS_DENIED;
        }