]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: use openat_pathref_fsp() in get_correct_cversion()
authorRalph Boehme <slow@samba.org>
Thu, 12 Nov 2020 11:47:19 +0000 (12:47 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
Ensures we have a pathref handle in the smb_fname we pass to
SMB_VFS_CREATE_FILE().

As the create_disposition is FILE_OPEN we just return the error if
openat_pathref_fsp() fails

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/printing/nt_printing.c

index d274dddb9443c878b019496c28d5936808e48aa6..aaa4792c16083a1ebb287739e01b62461cc3aac2 100644 (file)
@@ -1098,6 +1098,11 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
                goto error_exit;
        }
 
+       nt_status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
+       if (!NT_STATUS_IS_OK(nt_status)) {
+               return false;
+       }
+
        nt_status = SMB_VFS_CREATE_FILE(
                conn,                                   /* conn */
                NULL,                                   /* req */