From d2ff049ba9b68d017002ce92251e3a03593ef8c5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 8 Jun 2021 13:12:55 -0700 Subject: [PATCH] s3: smbd: Ensure we only call get_acl_group_bits() with a valid smb_fname->fsp. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/dosmode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index a858edee558..d6b5695f8a7 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -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; -- 2.47.3