From: Ralph Boehme Date: Sat, 7 Sep 2024 13:52:04 +0000 (+0200) Subject: smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when changing timestamps X-Git-Tag: tdb-1.4.13~695 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5e37ed09946ff52cdb2249350d2f4d5ed5a809b7;p=thirdparty%2Fsamba.git smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when changing timestamps Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/smbd/smb2_trans2.c b/source3/smbd/smb2_trans2.c index fd981ecb636..2a23f060325 100644 --- a/source3/smbd/smb2_trans2.c +++ b/source3/smbd/smb2_trans2.c @@ -3829,8 +3829,10 @@ NTSTATUS smb_set_file_time(connection_struct *conn, struct smb_file_time *ft, bool setting_write_time) { + const struct smb2_lease *lease = NULL; struct files_struct *set_fsp = NULL; struct timeval_buf tbuf[4]; + uint32_t action = NOTIFY_ACTION_MODIFIED; uint32_t filter = FILE_NOTIFY_CHANGE_LAST_ACCESS |FILE_NOTIFY_CHANGE_LAST_WRITE @@ -3898,6 +3900,8 @@ NTSTATUS smb_set_file_time(connection_struct *conn, timespec_string_buf(&ft->mtime, true, &tbuf[0])); set_sticky_write_time_fsp(set_fsp, ft->mtime); + action |= NOTIFY_ACTION_DIRLEASE_BREAK; + lease = fsp_get_smb2_lease(fsp); } DBG_DEBUG("setting utimes to modified values.\n"); @@ -3908,10 +3912,10 @@ NTSTATUS smb_set_file_time(connection_struct *conn, } notify_fname(conn, - NOTIFY_ACTION_MODIFIED, + action, filter, smb_fname, - NULL); + lease); return NT_STATUS_OK; }