From ef5e913bca584f0232d5bfff14df4ccba2dda35c Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 12 Nov 2020 12:39:29 +0100 Subject: [PATCH] printing: use openat_pathref_fsp() in file_version_is_newer() 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 b8a596ee34d..d274dddb944 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -889,6 +889,11 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr goto error_exit; } + status = openat_pathref_fsp(conn->cwd_fsp, smb_fname); + if (!NT_STATUS_IS_OK(status)) { + return false; + } + status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */ -- 2.47.3