]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Ensure we only call get_acl_group_bits() with a valid smb_fname->fsp.
authorJeremy Allison <jra@samba.org>
Tue, 8 Jun 2021 20:12:55 +0000 (13:12 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/dosmode.c

index a858edee55859ffcb6bd4136a392df6e3b091f8f..d6b5695f8a7fa2df6d597827739724d3c508ba3c 100644 (file)
@@ -959,8 +959,10 @@ int file_set_dosmode(connection_struct *conn,
 
        unixmode = smb_fname->st.st_ex_mode;
 
-       get_acl_group_bits(conn, smb_fname,
+       if (smb_fname->fsp != NULL) {
+               get_acl_group_bits(conn, smb_fname,
                        &smb_fname->st.st_ex_mode);
+       }
 
        if (S_ISDIR(smb_fname->st.st_ex_mode))
                dosmode |= FILE_ATTRIBUTE_DIRECTORY;