]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: trigger NOTIFY_ACTION_DIRLEASE_BREAK when modifying DOS attributes
authorRalph Boehme <slow@samba.org>
Thu, 5 Sep 2024 17:29:23 +0000 (19:29 +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/dosmode.c

index 26356bc721b8287b366c81abfcb92afe20608485..f39f8a7d15bf0372bc4e2a1ffa1ebd00144c54b3 100644 (file)
@@ -1072,10 +1072,11 @@ int file_set_dosmode(connection_struct *conn,
 done:
        if (!newfile) {
                notify_fname(conn,
-                            NOTIFY_ACTION_MODIFIED,
+                            NOTIFY_ACTION_MODIFIED |
+                            NOTIFY_ACTION_DIRLEASE_BREAK,
                             FILE_NOTIFY_CHANGE_ATTRIBUTES,
                             smb_fname,
-                            NULL);
+                            fsp_get_smb2_lease(smb_fname->fsp));
        }
        if (ret == 0) {
                smb_fname->st.st_ex_mode = unixmode;
@@ -1176,10 +1177,11 @@ NTSTATUS file_set_sparse(connection_struct *conn,
        }
 
        notify_fname(conn,
-                    NOTIFY_ACTION_MODIFIED,
+                    NOTIFY_ACTION_MODIFIED |
+                    NOTIFY_ACTION_DIRLEASE_BREAK,
                     FILE_NOTIFY_CHANGE_ATTRIBUTES,
                     fsp->fsp_name,
-                    NULL);
+                    fsp_get_smb2_lease(fsp));
 
        fsp->fsp_name->st.cached_dos_attributes = new_dosmode;
        fsp->fsp_flags.is_sparse = sparse;