From 36b03af0ea25ca5f390fcc597ff258e1662d1536 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Thu, 12 Nov 2020 14:57:45 +0100 Subject: [PATCH] printing: use openat_pathref_fsp() in driver_unlink_internals() 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 Reviewed-by: Jeremy Allison --- source3/printing/nt_printing.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index aaa4792c160..26b1dfd98b3 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -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);