From b7bb348bfe7a2cfda52a9c4ef8b64bb9f057b0a0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 29 Sep 2020 14:24:10 -0700 Subject: [PATCH] s3: smbd: Remove wrapper resolve_dfspath_wcard(). Just call dfs_redirect() directly. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/filename.c | 8 ++++---- source3/smbd/msdfs.c | 24 +----------------------- source3/smbd/proto.h | 12 ++++++------ 3 files changed, 11 insertions(+), 33 deletions(-) diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 459f78cf618..00e5d93cc95 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -1823,14 +1823,14 @@ char *get_original_lcomp(TALLOC_CTX *ctx, NTSTATUS status; if (ucf_flags & UCF_DFS_PATHNAME) { - status = resolve_dfspath_wcard(ctx, + status = dfs_redirect(ctx, conn, filename_in, ucf_flags, !conn->sconn->using_smb2, &fname); if (!NT_STATUS_IS_OK(status)) { - DBG_DEBUG("resolve_dfspath " + DBG_DEBUG("dfs_redirect " "failed for name %s with %s\n", filename_in, nt_errstr(status)); @@ -1924,13 +1924,13 @@ static NTSTATUS filename_convert_internal(TALLOC_CTX *ctx, if (ucf_flags & UCF_DFS_PATHNAME) { char *fname = NULL; - status = resolve_dfspath_wcard(ctx, conn, + status = dfs_redirect(ctx, conn, name_in, ucf_flags, !conn->sconn->using_smb2, &fname); if (!NT_STATUS_IS_OK(status)) { - DEBUG(10,("filename_convert_internal: resolve_dfspath " + DEBUG(10,("filename_convert_internal: dfs_redirect " "failed for name %s with %s\n", name_in, nt_errstr(status) )); diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index 9878be59633..239df15aba9 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -816,7 +816,7 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx, returned to the client. *****************************************************************/ -static NTSTATUS dfs_redirect(TALLOC_CTX *ctx, +NTSTATUS dfs_redirect(TALLOC_CTX *ctx, connection_struct *conn, const char *path_in, uint32_t ucf_flags, @@ -1803,25 +1803,3 @@ struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, } return jn; } - -/****************************************************************************** - Core function to resolve a dfs pathname. -******************************************************************************/ - -NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx, - connection_struct *conn, - const char *name_in, - uint32_t ucf_flags, - bool allow_broken_path, - char **pp_name_out) -{ - NTSTATUS status = NT_STATUS_OK; - - status = dfs_redirect(ctx, - conn, - name_in, - ucf_flags, - allow_broken_path, - pp_name_out); - return status; -} diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index c25ba5340b7..149abf9e589 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -549,12 +549,12 @@ bool remove_msdfs_link(const struct junction_map *jucn, struct junction_map *enum_msdfs_links(TALLOC_CTX *ctx, struct auth_session_info *session_info, size_t *p_num_jn); -NTSTATUS resolve_dfspath_wcard(TALLOC_CTX *ctx, - connection_struct *conn, - const char *name_in, - uint32_t ucf_flags, - bool allow_broken_path, - char **pp_name_out); +NTSTATUS dfs_redirect(TALLOC_CTX *ctx, + connection_struct *conn, + const char *name_in, + uint32_t ucf_flags, + bool allow_broken_path, + char **pp_name_out); struct connection_struct; struct smb_filename; struct conn_struct_tos { -- 2.47.3