From 412373984db6d0c20ba38076d06d0a87631890d0 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 23 May 2023 17:26:03 +0200 Subject: [PATCH] smbd: also reset struct stat_ex.cached_dos_attributes in SET_STAT_INVALID() BUG: https://bugzilla.samba.org/show_bug.cgi?id=15375 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Wed May 24 21:42:50 UTC 2023 on atb-devel-224 --- source3/include/smb_macros.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 0f44d1402a8..42ff9ffb0d4 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -108,7 +108,10 @@ #define VALID_STAT(st) ((st).st_ex_nlink != 0) #define VALID_STAT_OF_DIR(st) (VALID_STAT(st) && S_ISDIR((st).st_ex_mode)) -#define SET_STAT_INVALID(st) ((st).st_ex_nlink = 0) +#define SET_STAT_INVALID(st) { \ + (st).st_ex_nlink = 0; \ + (st).cached_dos_attributes = FILE_ATTRIBUTES_INVALID; \ +}; /* Macros to get at offsets within smb_lkrng and smb_unlkrng structures. We cannot define these as actual structures -- 2.11.4.GIT