Fix bug #9189 - SMB2 Create doesn't return correct MAX ACCESS access mask in blob.
authorJeremy Allison <jra@samba.org>
Thu, 20 Sep 2012 19:32:10 +0000 (12:32 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 25 Sep 2012 01:07:50 +0000 (03:07 +0200)
If we aren't already granted DELETE access, check if we have
DELETE_CHILD in the containing directory.

source3/smbd/open.c

index a06a9f25207ff92b21959a481eca0528222c7e14..73127075bbc98d84008883b3b1424bdab2b6c9eb 100644 (file)
@@ -1714,6 +1714,13 @@ static NTSTATUS smbd_calculate_maximum_allowed_access(
                return NT_STATUS_ACCESS_DENIED;
        }
        *p_access_mask = (access_granted | FILE_READ_ATTRIBUTES);
+
+       if (!(access_granted & DELETE_ACCESS)) {
+               if (can_delete_file_in_directory(conn, smb_fname)) {
+                       *p_access_mask |= DELETE_ACCESS;
+               }
+       }
+
        return NT_STATUS_OK;
 }