]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
printing: use openat_pathref_fsp() in driver_unlink_internals()
authorRalph Boehme <slow@samba.org>
Thu, 12 Nov 2020 13:57:45 +0000 (14:57 +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 aaa4792c16083a1ebb287739e01b62461cc3aac2..26b1dfd98b3d6165498791acd84b8ca1a45df9ad 100644 (file)
@@ -2042,6 +2042,14 @@ static NTSTATUS driver_unlink_internals(connection_struct *conn,
                goto err_out;
        }
 
+       status = openat_pathref_fsp(conn->cwd_fsp, smb_fname);
+       if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) {
+               status = NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+       if (!NT_STATUS_IS_OK(status)) {
+               goto err_out;
+       }
+
        status = unlink_internals(conn, NULL, 0, smb_fname, false);
 err_out:
        talloc_free(tmp_ctx);