]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: use openat_pathref_fsp() in file_version_is_newer()
authorRalph Boehme <slow@samba.org>
Thu, 12 Nov 2020 11:39:29 +0000 (12:39 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 16 Dec 2020 09:08:31 +0000 (09:08 +0000)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/printing/nt_printing.c

index b8a596ee34d56817b6d7e9351feaf49e79c40021..d274dddb9443c878b019496c28d5936808e48aa6 100644 (file)
@@ -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 */