From: Ralph Boehme Date: Thu, 12 Nov 2020 11:47:19 +0000 (+0100) Subject: printing: use openat_pathref_fsp() in get_correct_cversion() X-Git-Tag: samba-4.14.0rc1~350 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a74f0af1a91fe0bbc68e4d41d65f43ec383ae8bf;p=thirdparty%2Fsamba.git printing: use openat_pathref_fsp() in get_correct_cversion() 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 Reviewed-by: Jeremy Allison --- diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index d274dddb944..aaa4792c160 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -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 */