]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: deal with non FSA fsps in check_access_fsp()
authorRalph Boehme <slow@samba.org>
Tue, 17 Nov 2020 11:09:05 +0000 (12:09 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
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>
source3/smbd/trans2.c

index d7a1dca611c0e7395c38bacb60a1e6d9d6274446..03398ab140c093b1a00e904c99081190048d790a 100644 (file)
@@ -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;
        }