From 3572ffa6c5d11a2d07f3a5ae158e8f9860f34cf6 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Wed, 2 Oct 2024 14:09:33 +0200 Subject: [PATCH] smbd: fix share access check for overwrite dispostions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=15732 Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Mon Oct 14 12:23:04 UTC 2024 on atb-devel-224 (cherry picked from commit 6140c3177a0330f42411618c3fca28930ea02a21) --- selftest/knownfail.d/samba3.smb2.acls | 1 - source3/smbd/open.c | 6 +++++- 2 files changed, 5 insertions(+), 2 deletions(-) delete mode 100644 selftest/knownfail.d/samba3.smb2.acls diff --git a/selftest/knownfail.d/samba3.smb2.acls b/selftest/knownfail.d/samba3.smb2.acls deleted file mode 100644 index 18df260c0e5..00000000000 --- a/selftest/knownfail.d/samba3.smb2.acls +++ /dev/null @@ -1 +0,0 @@ -^samba3.smb2.acls.OVERWRITE_READ_ONLY_FILE diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 49ab10d224d..0820b96049f 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3376,6 +3376,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, @@ -3402,7 +3403,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, @@ -3732,6 +3733,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; @@ -3760,6 +3762,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, @@ -4394,6 +4397,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,