From: Jeremy Allison Date: Tue, 29 Sep 2020 18:36:50 +0000 (-0700) Subject: s3: smbd: In SMB2 query directory we don't need to do full path resolution of the... X-Git-Tag: talloc-2.3.2~408 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=078f2d94563922cdba01d609efad3d668e2115d8;p=thirdparty%2Fsamba.git s3: smbd: In SMB2 query directory we don't need to do full path resolution of the mask component. get_original_lcomp() does all the name canonicalization required for the mask. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c index b8b53e27739..b72639630b3 100644 --- a/source3/smbd/smb2_query_directory.c +++ b/source3/smbd/smb2_query_directory.c @@ -398,43 +398,6 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx, /* Ensure we've canonicalized any search path if not a wildcard. */ if (!wcard_has_wild) { - struct smb_filename *smb_fname = NULL; - const char *fullpath; - char tmpbuf[PATH_MAX]; - char *to_free = NULL; - uint32_t ucf_flags = UCF_ALWAYS_ALLOW_WCARD_LCOMP | - (state->smbreq->posix_pathnames ? - UCF_POSIX_PATHNAMES : 0); - - if (ISDOT(fsp->fsp_name->base_name)) { - fullpath = state->in_file_name; - } else { - size_t len; - char *tmp; - - len = full_path_tos( - fsp->fsp_name->base_name, state->in_file_name, - tmpbuf, sizeof(tmpbuf), &tmp, &to_free); - if (len == -1) { - tevent_req_oom(req); - return tevent_req_post(req, ev); - } - fullpath = tmp; - } - status = filename_convert(state, - conn, - fullpath, - ucf_flags, - 0, - &wcard_has_wild, - &smb_fname); - - TALLOC_FREE(to_free); - - if (tevent_req_nterror(req, status)) { - return tevent_req_post(req, ev); - } - /* * We still need to do the case processing * to save off the client-supplied last component.