From: Ralph Boehme Date: Thu, 12 Nov 2020 13:52:31 +0000 (+0100) Subject: smbd: use openat_pathref_fsp() in reply_search() X-Git-Tag: samba-4.14.0rc1~347 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=14b0cc6b9a1027b4d6d95be58d05f72e375d9f56;p=thirdparty%2Fsamba.git smbd: use openat_pathref_fsp() in reply_search() 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/reply.c b/source3/smbd/reply.c index a8b3f028fea..e945c4ecbe5 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1837,6 +1837,15 @@ void reply_search(struct smb_request *req) goto out; } + nt_status = openat_pathref_fsp(conn->cwd_fsp, smb_dname); + if (NT_STATUS_EQUAL(nt_status, NT_STATUS_STOPPED_ON_SYMLINK)) { + nt_status = NT_STATUS_OBJECT_NAME_NOT_FOUND; + } + if (!NT_STATUS_IS_OK(nt_status)) { + reply_nterror(req, nt_status); + goto out; + } + /* * Open an fsp on this directory for the dptr. */