From 8c1fd86db873f0326faf1cefa731a03709f8ac7f Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Tue, 16 Feb 2021 14:19:51 +0100 Subject: [PATCH] printing: use correct error out in file_version_is_newer() when openat_pathref_fsp() fails Fixes a regression introduced by cbe25e1777d0c43c21e8acc2cea79fd03fdaf2ea: 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 --- source3/printing/nt_printing.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 9b7904f6778..0788134bf87 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -833,7 +833,8 @@ 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; + ret = 1; + goto done; } status = SMB_VFS_CREATE_FILE( -- 2.34.1