1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

rpc_server3: Inline make_internal_ncacn_conn() into rpc_worker.c

This was the only user, and as we have another custom version in
winbind with make_internal_ncacn_conn(), I think this is not really
required to keep around as a separate function.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2021-09-28 13:26:18 +02:00 committed by Jeremy Allison
parent 22176770ad
commit 0f9f1fa0c2
3 changed files with 12 additions and 51 deletions

View File

@ -51,35 +51,6 @@ struct dcerpc_ncacn_listen_state {
void *termination_data;
};
NTSTATUS dcerpc_ncacn_conn_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
struct dcesrv_context *dce_ctx,
struct dcesrv_endpoint *endpoint,
dcerpc_ncacn_termination_fn term_fn,
void *termination_data,
struct dcerpc_ncacn_conn **out)
{
struct dcerpc_ncacn_conn *ncacn_conn = NULL;
ncacn_conn = talloc_zero(mem_ctx, struct dcerpc_ncacn_conn);
if (ncacn_conn == NULL) {
return NT_STATUS_NO_MEMORY;
}
ncacn_conn->ev_ctx = ev_ctx;
ncacn_conn->msg_ctx = msg_ctx;
ncacn_conn->dce_ctx = dce_ctx;
ncacn_conn->endpoint = endpoint;
ncacn_conn->sock = -1;
ncacn_conn->termination_fn = term_fn;
ncacn_conn->termination_data = termination_data;
*out = ncacn_conn;
return NT_STATUS_OK;
}
static void ncacn_terminate_connection(struct dcerpc_ncacn_conn *conn,
const char *reason);

View File

@ -53,15 +53,6 @@ struct dcerpc_ncacn_conn {
struct auth_session_info *session_info;
};
NTSTATUS dcerpc_ncacn_conn_init(TALLOC_CTX *mem_ctx,
struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
struct dcesrv_context *dce_ctx,
struct dcesrv_endpoint *endpoint,
dcerpc_ncacn_termination_fn term_fn,
void *termination_data,
struct dcerpc_ncacn_conn **out);
void set_incoming_fault(struct pipes_struct *p);
void process_complete_pdu(struct pipes_struct *p, struct ncacn_packet *pkt);

View File

@ -243,21 +243,20 @@ static void rpc_worker_new_client(
goto fail;
}
status = dcerpc_ncacn_conn_init(
dce_ctx,
global_event_context(),
global_messaging_context(),
dce_ctx,
ep,
rpc_worker_connection_terminated,
worker,
&ncacn_conn);
if (!NT_STATUS_IS_OK(status)) {
DBG_DEBUG("dcerpc_ncacn_conn_init() failed: %s\n",
nt_errstr(status));
ncacn_conn = talloc(dce_ctx, struct dcerpc_ncacn_conn);
if (ncacn_conn == NULL) {
DBG_DEBUG("talloc failed\n");
goto fail;
}
ncacn_conn->sock = sock;
*ncacn_conn = (struct dcerpc_ncacn_conn) {
.ev_ctx = global_event_context(),
.msg_ctx = global_messaging_context(),
.dce_ctx = dce_ctx,
.endpoint = ep,
.sock = sock,
.termination_fn = rpc_worker_connection_terminated,
.termination_data = worker,
};
if (transport == NCALRPC) {
ret = tsocket_address_unix_from_path(