]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: fix sharing access check for directories
authorRalph Boehme <slow@samba.org>
Fri, 25 Oct 2024 15:22:57 +0000 (17:22 +0200)
committerJule Anger <janger@samba.org>
Thu, 7 Nov 2024 08:18:17 +0000 (08:18 +0000)
This was missing from commit 6140c3177a0330f42411618c3fca28930ea02a21 and causes
all opens of directories to be handled as stat opens, bypassing the sharemode
check.

Not adding a test at this time, as my (hopefully) soon to be merged Directory
Leases branch has a test which actually detected this problem.

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>
(cherry picked from commit 20206a335a6af71b99f6441df145feea6563cf5a)

source3/smbd/open.c

index 0820b96049f782f35c175ec3e78bc074692ae573..6310c8a1d84495f1a10a730a452d543a7f921411 100644 (file)
@@ -5096,6 +5096,7 @@ static NTSTATUS open_directory(connection_struct *conn,
                .req                    = req,
                .create_disposition     = create_disposition,
                .access_mask            = access_mask,
+               .open_access_mask       = access_mask,
                .share_access           = share_access,
                .oplock_request         = NO_OPLOCK,
                .lease                  = NULL,