]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: fix handing of oplock_request and INTERNAL_OPEN_ONLY
authorRalph Boehme <slow@samba.org>
Sun, 24 Aug 2025 06:45:39 +0000 (08:45 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 10 Oct 2025 15:59:35 +0000 (15:59 +0000)
Avoid overwriting INTERNAL_OPEN_ONLY in oplock_request and fix setting
oplock_request to INTERNAL_OPEN_ONLY.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/open.c

index e898829c52c83e43ef3c0635473f437941c5679b..b0a080fabf2f196c6cc4b0b22b0d05affe5b832e 100644 (file)
@@ -3816,7 +3816,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
                 * which adds FILE_WRITE_DATA to open_access_mask.
                 */
                if (is_oplock_stat_open(open_access_mask) && lease == NULL) {
-                       oplock_request = NO_OPLOCK;
+                       oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK;
                }
        }
 
@@ -5163,7 +5163,7 @@ static NTSTATUS open_directory(connection_struct *conn,
                /*
                 * No oplocks on directories, only leases
                 */
-               oplock_request = NO_OPLOCK;
+               oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK;
        }
 
        lck_state = (struct open_ntcreate_lock_state) {
@@ -6169,7 +6169,7 @@ static NTSTATUS create_file_unixpath(connection_struct *conn,
        }
 
        if (req == NULL) {
-               oplock_request |= INTERNAL_OPEN_ONLY;
+               oplock_request = INTERNAL_OPEN_ONLY;
        }
 
        if (lease != NULL) {