]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
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)
committerJule Anger <janger@samba.org>
Fri, 28 Mar 2025 14:53:26 +0000 (14:53 +0000)
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

(cherry picked from commit 4b3f45e13f9c11920924c034a457ea2cb8e15e18)

Autobuild-User(v4-22-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-22-test): Fri Mar 28 14:53:26 UTC 2025 on atb-devel-224

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

diff --git a/selftest/knownfail.d/samba3.smb2.dirlease b/selftest/knownfail.d/samba3.smb2.dirlease
deleted file mode 100644 (file)
index 0aa9d23..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smb2.dirlease.oplocks\(fileserver\)
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",