From: Ralph Boehme Date: Mon, 14 Oct 2024 16:47:48 +0000 (+0200) Subject: smbd: break handle leases when setting SMB_FILE_DISPOSITION_INFORMATION X-Git-Tag: tdb-1.4.13~742 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6cc25159d5a0b5be024629467b866939dd667036;p=thirdparty%2Fsamba.git smbd: break handle leases when setting SMB_FILE_DISPOSITION_INFORMATION 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 Reviewed-by: Stefan Metzmacher --- diff --git a/source3/smbd/smb2_setinfo.c b/source3/smbd/smb2_setinfo.c index db6ca6d1204..9681e251b0a 100644 --- a/source3/smbd/smb2_setinfo.c +++ b/source3/smbd/smb2_setinfo.c @@ -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,