]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
rpc_server3: Inline single-use rpcint_binding_handle_ex()
authorVolker Lendecke <vl@samba.org>
Thu, 7 Oct 2021 12:52:47 +0000 (14:52 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 5 Jan 2022 00:11:38 +0000 (00:11 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/rpc_server/rpc_ncacn_np.c

index a5dc8707b19186f1e8f76b351d59cbbc9cd3bc00..03618df41e0578d18cef91fb30d1143f88d1fc5d 100644 (file)
@@ -78,40 +78,6 @@ fail:
        return NULL;
 }
 
-static NTSTATUS rpcint_binding_handle_ex(TALLOC_CTX *mem_ctx,
-                       const struct ndr_syntax_id *abstract_syntax,
-                       const struct ndr_interface_table *ndr_table,
-                       const struct tsocket_address *remote_address,
-                       const struct tsocket_address *local_address,
-                       const struct auth_session_info *session_info,
-                       struct messaging_context *msg_ctx,
-                       struct dcerpc_binding_handle **binding_handle)
-{
-       struct rpc_pipe_client *rpccli = NULL;
-       NTSTATUS status;
-
-       status = rpc_pipe_open_local_np(
-               mem_ctx,
-               ndr_table,
-               NULL,
-               remote_address,
-               NULL,
-               local_address,
-               session_info,
-               &rpccli);
-       if (!NT_STATUS_IS_OK(status)) {
-               DBG_DEBUG("rpc_pipe_open_local_np failed: %s\n",
-                         nt_errstr(status));
-               goto fail;
-       }
-
-       *binding_handle = rpccli->binding_handle;
-       return NT_STATUS_OK;
-fail:
-       TALLOC_FREE(rpccli);
-       return status;
-}
-
 /**
  * @brief Create a new DCERPC Binding Handle which uses a local dispatch function.
  *
@@ -151,9 +117,29 @@ NTSTATUS rpcint_binding_handle(TALLOC_CTX *mem_ctx,
                               struct messaging_context *msg_ctx,
                               struct dcerpc_binding_handle **binding_handle)
 {
-       return rpcint_binding_handle_ex(mem_ctx, NULL, ndr_table, remote_address,
-                                       local_address, session_info,
-                                       msg_ctx, binding_handle);
+       struct rpc_pipe_client *rpccli = NULL;
+       NTSTATUS status;
+
+       status = rpc_pipe_open_local_np(
+               mem_ctx,
+               ndr_table,
+               NULL,
+               remote_address,
+               NULL,
+               local_address,
+               session_info,
+               &rpccli);
+       if (!NT_STATUS_IS_OK(status)) {
+               DBG_DEBUG("rpc_pipe_open_local_np failed: %s\n",
+                         nt_errstr(status));
+               goto fail;
+       }
+
+       *binding_handle = rpccli->binding_handle;
+       return NT_STATUS_OK;
+fail:
+       TALLOC_FREE(rpccli);
+       return status;
 }
 
 /**