]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Fix smbd_check_access_rights_fsp() to cope with fake/printer fsp's.
authorJeremy Allison <jra@samba.org>
Fri, 4 Jun 2021 00:37:57 +0000 (17:37 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 9 Jun 2021 13:14:30 +0000 (13:14 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/open.c

index b1d90412bf1c1814fd423d3d517b9643022e6d64..fc15e66ea0acfae767e3685d4a1db7fed0e2485d 100644 (file)
@@ -287,6 +287,14 @@ NTSTATUS smbd_check_access_rights_fsp(struct files_struct *fsp,
        struct security_descriptor *sd = NULL;
        NTSTATUS status;
 
+       /* Cope with fake/printer fsp's. */
+       if (fsp->fake_file_handle != NULL || fsp->print_file != NULL) {
+               if ((fsp->access_mask & access_mask) != access_mask) {
+                       return NT_STATUS_ACCESS_DENIED;
+               }
+               return NT_STATUS_OK;
+       }
+
        status = SMB_VFS_FGET_NT_ACL(fsp,
                                     (SECINFO_OWNER |
                                      SECINFO_GROUP |