From: Ralph Boehme Date: Thu, 12 Nov 2020 11:39:29 +0000 (+0100) Subject: printing: use openat_pathref_fsp() in file_version_is_newer() X-Git-Tag: samba-4.14.0rc1~351 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef5e913bca584f0232d5bfff14df4ccba2dda35c;p=thirdparty%2Fsamba.git 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 --- 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 */