]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: break handle leases when setting SMB_FILE_DISPOSITION_INFORMATION
authorRalph Boehme <slow@samba.org>
Mon, 14 Oct 2024 16:47:48 +0000 (18:47 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Nov 2024 14:39:30 +0000 (14:39 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13458
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15608

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/smb2_setinfo.c

index db6ca6d12046c8a0cfb2f09ff8e43c52095454a0..9681e251b0a3b673fc3051e2e5ed31d4552fbb09 100644 (file)
@@ -441,10 +441,23 @@ static void smbd_smb2_setinfo_lease_break_fsp_check(struct tevent_req *req)
        struct tevent_req *subreq = NULL;
        struct timeval timeout;
        bool rename;
+       bool delete_on_close;
        NTSTATUS status;
 
        rename = (file_info_level == SMB2_FILE_RENAME_INFORMATION_INTERNAL);
-       if (!rename) {
+
+       if (file_info_level == SMB_FILE_DISPOSITION_INFORMATION) {
+               status = smb_check_file_disposition_info(
+                       fsp,
+                       (char *)state->data.data,
+                       state->data.length,
+                       &delete_on_close);
+               if (tevent_req_nterror(req, status)) {
+                       return;
+               }
+       }
+
+       if (!rename && !delete_on_close) {
                return;
        }
 
@@ -507,7 +520,7 @@ static void smbd_smb2_setinfo_lease_break_fsp_done(struct tevent_req *subreq)
                return;
        }
 
-       /* Do the rename under the lock. */
+       /* Do the setinfo again under the lock. */
        status = smbd_do_setfilepathinfo(state->fsp->conn,
                                state->smb2req->smb1req,
                                state,