]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when changing timestamps
authorRalph Boehme <slow@samba.org>
Sat, 7 Sep 2024 13:52:04 +0000 (15:52 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 5 Nov 2024 14:39:30 +0000 (14:39 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/smb2_trans2.c

index fd981ecb63644d68d9afb45dcfec9e879857e87a..2a23f06032578b288980625ea107301b89144661 100644 (file)
@@ -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;
 }