From 192897b49bbaaf3dfb3db00f8c0b16c721d669f8 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 17 Nov 2020 12:09:05 +0100 Subject: [PATCH] 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 --- source3/smbd/trans2.c | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.47.3