smbd: move POSIX check from possibly_set_archive() to file_set_dosmode()
authorRalph Boehme <slow@samba.org>
Tue, 31 Oct 2023 11:16:59 +0000 (12:16 +0100)
committerJeremy Allison <jra@samba.org>
Sun, 5 Nov 2023 18:34:38 +0000 (18:34 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/dosmode.c
source3/smbd/open.c

index f544ef96177b12751c25d59417b31b880b470c17..c76a27dc71d1564c95591302c053e87033e948c7 100644 (file)
@@ -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);
index d5cfe7832cfe7cad4c216ca28be5db993ba139d1..814097622118e94587e65c741ef49eb9f131fe00 100644 (file)
@@ -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,