From: Ralph Boehme Date: Thu, 12 Nov 2020 11:56:56 +0000 (+0100) Subject: smbd: use openat_pathref_fsp() in open_streams_for_delete() X-Git-Tag: samba-4.14.0rc1~348 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bdaba47f4a6cfef6740fda84f983bf316562ed2;p=thirdparty%2Fsamba.git smbd: use openat_pathref_fsp() in open_streams_for_delete() 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/smbd/open.c b/source3/smbd/open.c index 3fbb72572d8..361c35303f6 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -4828,6 +4828,18 @@ static NTSTATUS open_streams_for_delete(connection_struct *conn, smb_fname_str_dbg(smb_fname_cp))); } + status = openat_pathref_fsp(conn->cwd_fsp, smb_fname_cp); + if (NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) { + status = NT_STATUS_OBJECT_NAME_NOT_FOUND; + } + if (!NT_STATUS_IS_OK(status)) { + DBG_DEBUG("Unable to open stream [%s]: %s\n", + smb_fname_str_dbg(smb_fname_cp), + nt_errstr(status)); + TALLOC_FREE(smb_fname_cp); + break; + } + status = SMB_VFS_CREATE_FILE( conn, /* conn */ NULL, /* req */