From 7c7786a121cedd56c37c7b349912680780b151f6 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 31 Oct 2023 10:06:38 +0100 Subject: [PATCH] smbd: ignore symlinks in file_set_dosmode() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/smbd/dosmode.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 2eef953a9cb..8b51f5a7d8b 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -903,6 +903,11 @@ int file_set_dosmode(connection_struct *conn, return -1; } + if (S_ISLNK(smb_fname->st.st_ex_mode)) { + /* A symlink in POSIX context, ignore */ + return 0; + } + if ((S_ISDIR(smb_fname->st.st_ex_mode)) && (dosmode & FILE_ATTRIBUTE_TEMPORARY)) {