1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when removing directories

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Ralph Boehme 2024-09-07 15:20:14 +02:00
parent 1a3606985c
commit 680da2b3af

View File

@ -1614,12 +1614,28 @@ done:
remove_pending_change_notify_requests_by_fid(fsp, notify_status);
if (lck_state.delete_object) {
if (lck_state.delete_object && NT_STATUS_IS_OK(status)) {
const struct smb2_lease *lease = fsp_get_smb2_lease(fsp);
if (lease != NULL) {
/*
* If parent lease key of handle on which delete
* disposition was set does not match the parent lease
* key of last closed handle, break all leases on the
* parent directory.
*/
if (!smb2_lease_key_equal(&lease->parent_lease_key,
&lck_state.parent_lease_key))
{
lease = NULL;
}
}
notify_fname(conn,
NOTIFY_ACTION_REMOVED,
NOTIFY_ACTION_REMOVED |
NOTIFY_ACTION_DIRLEASE_BREAK,
FILE_NOTIFY_CHANGE_DIR_NAME,
fsp->fsp_name,
NULL);
lease);
}
status1 = fd_close(fsp);