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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
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;
}