smbd: fix handling of directory leases and oplock levels
authorRalph Boehme <slow@samba.org>
Sat, 22 Mar 2025 15:59:07 +0000 (16:59 +0100)
committerMichael Tokarev <mjt@tls.msk.ru>
Sat, 29 Mar 2025 04:24:47 +0000 (07:24 +0300)
From 4b3f45e13f9c11920924c034a457ea2cb8e15e18 Mon Sep 17 00:00:00 2001
Origin: upstream, https://bugzilla.samba.org/show_bug.cgi?id=15836
Forwarded: yes
Bug-Debian: https://bugs.debian.org/1100604

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15836

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): Fri Mar 28 07:53:25 UTC 2025 on atb-devel-224

Gbp-Pq: Name smbd-fix-handling-of-directory-leases-and-oplock-lev.patch

source3/smbd/open.c

index 771734f6203c50f23c1ff34ae6f86379349ad480..540dc7a0c60f09ff9147e6a0e2d66c0a586390a8 100644 (file)
@@ -5191,6 +5191,13 @@ static NTSTATUS open_directory(connection_struct *conn,
                keep_locked = true;
        }
 
+       if ((oplock_request != NO_OPLOCK) && (oplock_request != LEASE_OPLOCK)) {
+               /*
+                * No oplocks on directories, only leases
+                */
+               oplock_request = NO_OPLOCK;
+       }
+
        lck_state = (struct open_ntcreate_lock_state) {
                .fsp                    = fsp,
                .object_type            = "directory",