From: Ralph Boehme Date: Tue, 17 Nov 2020 11:09:05 +0000 (+0100) Subject: smbd: deal with non FSA fsps in check_access_fsp() X-Git-Tag: samba-4.14.0rc1~311 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=192897b49bbaaf3dfb3db00f8c0b16c721d669f8;p=thirdparty%2Fsamba.git smbd: deal with non FSA fsps in check_access_fsp() For fsps coming out of openat_pathref_fsp() and not SMB_VFS_CREATE_FILE(), fsp->access_mask will be 0 and we check the requested rights against the permissions of the object opened by the fsp. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index d7a1dca611c..03398ab140c 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -97,6 +97,11 @@ static NTSTATUS refuse_symlink(connection_struct *conn, NTSTATUS check_access_fsp(struct files_struct *fsp, uint32_t access_mask) { + if (!fsp->fsp_flags.is_fsa) { + return smbd_check_access_rights_fsp(fsp, + false, + access_mask); + } if (!(fsp->access_mask & access_mask)) { return NT_STATUS_ACCESS_DENIED; }