From 4d1b4d893d2fe297218309736ae63bac63404b5b Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 31 Oct 2023 12:16:59 +0100 Subject: [PATCH] smbd: move POSIX check from possibly_set_archive() to file_set_dosmode() No change in behaviour. Move the check to the more low-level function file_set_dosmode() to ensure all callers use this consistently. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- source3/smbd/dosmode.c | 4 ++++ source3/smbd/open.c | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index f544ef96177..c76a27dc71d 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -925,6 +925,10 @@ int file_set_dosmode(connection_struct *conn, return -1; } + if (fsp->fsp_flags & FSP_POSIX_FLAGS_OPEN) { + return; + } + unixmode = smb_fname->st.st_ex_mode; get_acl_group_bits(conn, smb_fname->fsp, &smb_fname->st.st_ex_mode); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index d5cfe7832cf..81409762211 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3752,9 +3752,6 @@ static void possibly_set_archive(struct connection_struct *conn, if (!set_archive) { return; } - if (fsp->fsp_flags & FSP_POSIX_FLAGS_OPEN) { - return; - } ret = file_set_dosmode(conn, smb_fname,