]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Fix cached dos attributes
authorVolker Lendecke <vl@samba.org>
Mon, 24 Jun 2024 14:50:57 +0000 (16:50 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 28 Jun 2024 14:32:27 +0000 (14:32 +0000)
The callers of fset_dos_mode must set the cached attributes
themselves, which I did not see. I tried, but I did not find a clean
way to fix this behind SMB_VFS_FSET_DOS_ATTRIBUTES, with a smb_fname
and smb_fname->fsp->fsp_name we might have two copies of the cached
dos attributes around and if we only update fsp->fsp_name, we might
miss the outer one.

Not doing a test, this is really fresh code, and in the future we must
reorganize setting and caching dos attributes anyway.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jun 28 14:32:27 UTC 2024 on atb-devel-224

source3/modules/util_reparse.c

index 19a15a06c51f05d4e8ef1f195271d5686cfbaeb8..fce3603e7808bf19dc8303060abfb4d26df672ee 100644 (file)
@@ -211,6 +211,8 @@ NTSTATUS fsctl_set_reparse_point(struct files_struct *fsp,
                return status;
        }
 
+       fsp->fsp_name->st.cached_dos_attributes = dos_mode;
+
        return NT_STATUS_OK;
 }
 
@@ -277,5 +279,7 @@ NTSTATUS fsctl_del_reparse_point(struct files_struct *fsp,
                return status;
        }
 
+       fsp->fsp_name->st.cached_dos_attributes = dos_mode;
+
        return NT_STATUS_OK;
 }