]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: fix share access check for overwrite dispostions
authorRalph Boehme <slow@samba.org>
Wed, 2 Oct 2024 12:09:33 +0000 (14:09 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 14 Oct 2024 12:23:04 +0000 (12:23 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15732

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Oct 14 12:23:04 UTC 2024 on atb-devel-224

selftest/knownfail.d/samba3.smb2.acls [deleted file]
source3/smbd/open.c

diff --git a/selftest/knownfail.d/samba3.smb2.acls b/selftest/knownfail.d/samba3.smb2.acls
deleted file mode 100644 (file)
index 18df260..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.acls.OVERWRITE_READ_ONLY_FILE
index 33554fcee131c29d24a41e4b95a60ed1865cd078..f132587fb8c8549ad0aa480064595d218e3f71a7 100644 (file)
@@ -3389,6 +3389,7 @@ static NTSTATUS check_and_store_share_mode(
        struct share_mode_lock *lck,
        uint32_t create_disposition,
        uint32_t access_mask,
+       uint32_t open_access_mask,
        uint32_t share_access,
        int oplock_request,
        const struct smb2_lease *lease,
@@ -3415,7 +3416,7 @@ static NTSTATUS check_and_store_share_mode(
        status = handle_share_mode_lease(fsp,
                                         lck,
                                         create_disposition,
-                                        access_mask,
+                                        open_access_mask,
                                         share_access,
                                         oplock_request,
                                         lease,
@@ -3745,6 +3746,7 @@ struct open_ntcreate_lock_state {
        struct smb_request *req;
        uint32_t create_disposition;
        uint32_t access_mask;
+       uint32_t open_access_mask;
        uint32_t share_access;
        int oplock_request;
        const struct smb2_lease *lease;
@@ -3773,6 +3775,7 @@ static void open_ntcreate_lock_add_entry(struct share_mode_lock *lck,
                                                   lck,
                                                   state->create_disposition,
                                                   state->access_mask,
+                                                  state->open_access_mask,
                                                   state->share_access,
                                                   state->oplock_request,
                                                   state->lease,
@@ -4407,6 +4410,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                .req                    = req,
                .create_disposition     = create_disposition,
                .access_mask            = access_mask,
+               .open_access_mask       = open_access_mask,
                .share_access           = share_access,
                .oplock_request         = oplock_request,
                .lease                  = lease,