From: Ralph Boehme Date: Thu, 12 Nov 2020 13:57:45 +0000 (+0100) Subject: printing: use openat_pathref_fsp() in driver_unlink_internals() X-Git-Tag: samba-4.14.0rc1~346 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=36b03af0ea25ca5f390fcc597ff258e1662d1536;p=thirdparty%2Fsamba.git 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 --- 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);