]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: use correct error out in get_correct_cversion() when openat_pathref_fsp...
authorRalph Boehme <slow@samba.org>
Tue, 16 Feb 2021 13:24:05 +0000 (14:24 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 17 Feb 2021 19:53:00 +0000 (19:53 +0000)
Fixes a regression introduced by a74f0af1a91fe0bbc68e4d41d65f43ec383ae8bf: 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 <slow@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Feb 17 19:53:00 UTC 2021 on sn-devel-184

source3/printing/nt_printing.c

index e3cd8102851e430d7feb6f1b9ebcd9e3fdf8571f..e9253093ae232fa04991a84c975f299228d22323 100644 (file)
@@ -1104,7 +1104,10 @@ static uint32_t get_correct_cversion(const struct auth_session_info *session_inf
 
        nt_status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
        if (!NT_STATUS_IS_OK(nt_status)) {
-               return false;
+               DBG_NOTICE("Can't open file [%s], errno =%d\n",
+                          smb_fname_str_dbg(smb_fname), errno);
+               *perr = WERR_ACCESS_DENIED;
+               goto error_exit;
        }
 
        nt_status = SMB_VFS_CREATE_FILE(