From 0ebabaedbc06b3b4f658430dcf2edb0711f599fd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 24 Jun 2024 16:50:57 +0200 Subject: [PATCH] smbd: Fix cached dos attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Fri Jun 28 14:32:27 UTC 2024 on atb-devel-224 --- source3/modules/util_reparse.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/modules/util_reparse.c b/source3/modules/util_reparse.c index 19a15a06c51..fce3603e780 100644 --- a/source3/modules/util_reparse.c +++ b/source3/modules/util_reparse.c @@ -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; }