From: Ralph Boehme Date: Thu, 12 Nov 2020 11:38:43 +0000 (+0100) Subject: printing: use openat_pathref_fsp() in file_version_is_newer() X-Git-Tag: samba-4.14.0rc1~352 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbe25e1777d0c43c21e8acc2cea79fd03fdaf2ea;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 0e33c6a6876..b8a596ee34d 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -830,6 +830,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 */