From: Jeremy Allison Date: Thu, 3 Jun 2021 19:38:18 +0000 (-0700) Subject: s3: smbd: reply_copy(), is_visible_file() -> is_visible_fsp(). X-Git-Tag: tevent-0.11.0~572 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12cb13691e0fedd82a71d5f54d1eaf5da28a12ca;p=thirdparty%2Fsamba.git s3: smbd: reply_copy(), is_visible_file() -> is_visible_fsp(). Offtopic, the function reply_copy() is insane and should be removed. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 73e9146a969..7efccdeadf9 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -8972,15 +8972,6 @@ void reply_copy(struct smb_request *req) continue; } - if (!is_visible_file(conn, - dir_hnd, - dname, - &smb_fname_src->st, - false)) { - TALLOC_FREE(talloced); - continue; - } - if(!mask_match(dname, fname_src_mask, conn->case_sensitive)) { TALLOC_FREE(talloced); @@ -9025,6 +9016,23 @@ void reply_copy(struct smb_request *req) TALLOC_FREE(smb_fname_dst->base_name); smb_fname_dst->base_name = destname; + ZERO_STRUCT(smb_fname_src->st); + vfs_stat(conn, smb_fname_src); + + status = openat_pathref_fsp(conn->cwd_fsp, + smb_fname_src); + if (!NT_STATUS_IS_OK(status)) { + DBG_INFO("openat_pathref_fsp [%s] failed: %s\n", + smb_fname_str_dbg(smb_fname_src), + nt_errstr(status)); + break; + } + + if (!is_visible_fsp(smb_fname_src->fsp, false)) { + TALLOC_FREE(talloced); + continue; + } + status = check_name(conn, smb_fname_src); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(dir_hnd);