]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: In SMB2 query directory we don't need to do full path resolution of the...
authorJeremy Allison <jra@samba.org>
Tue, 29 Sep 2020 18:36:50 +0000 (11:36 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 30 Sep 2020 20:46:40 +0000 (20:46 +0000)
get_original_lcomp() does all the name canonicalization required for the mask.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/smb2_query_directory.c

index b8b53e27739d96aa8a1a06eee64b4fd2596dc98d..b72639630b395b7050f86ec5ca38fb9f65d0ddbb 100644 (file)
@@ -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.