From: Ralph Boehme Date: Tue, 16 Feb 2021 13:23:02 +0000 (+0100) Subject: printing: use correct error out in file_version_is_newer() when openat_pathref_fsp... X-Git-Tag: tevent-0.11.0~1740 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=70063c523bff5e471eac2b011b243c5aa0c4bee1;p=thirdparty%2Fsamba.git printing: use correct error out in file_version_is_newer() when openat_pathref_fsp() fails Fixes a regression introduced by ef5e913bca584f0232d5bfff14df4ccba2dda35c: if there's no existing file, openat_pathref_fsp() will fail with NT_STATUS_OBJECT_NAME_NOT_FOUND which must be handled the same way it is done by the SMB_VFS_CREATE_FILE() call below. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14635 Signed-off-by: Ralph Boehme Reviewed-by: Guenther Deschner --- diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 0788134bf87..e3cd8102851 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -893,7 +893,9 @@ static int file_version_is_newer(connection_struct *conn, fstring new_file, fstr status = openat_pathref_fsp(conn->cwd_fsp, smb_fname); if (!NT_STATUS_IS_OK(status)) { - return false; + DBG_NOTICE("Can't open new file [%s], errno = %d\n", + smb_fname_str_dbg(smb_fname), errno); + goto error_exit; } status = SMB_VFS_CREATE_FILE(