From a74f0af1a91fe0bbc68e4d41d65f43ec383ae8bf Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 12 Nov 2020 12:47:19 +0100 Subject: [PATCH] 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 --- source3/printing/nt_printing.c | 5 +++++ 1 file changed, 5 insertions(+) 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 */ -- 2.47.3