From: Stefan Metzmacher Date: Thu, 19 Sep 2024 22:24:05 +0000 (+0200) Subject: s3:rpc_client: only pass the pipe_name to rpc_transport_np_init_send() X-Git-Tag: samba-4.21.7~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e42835a2f5f132aad072d6f4a70589c70c192aec;p=thirdparty%2Fsamba.git s3:rpc_client: only pass the pipe_name to rpc_transport_np_init_send() There's no need to have the ndr_interface_table at that stage... Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme (cherry picked from commit 5b3573135b222755cd897d4539c0e5a89f7cdf5b) --- diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index b2588da57ca..86e437754f9 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -3325,6 +3325,7 @@ struct tevent_req *rpc_pipe_open_np_send( struct tevent_req *req = NULL, *subreq = NULL; struct rpc_pipe_open_np_state *state = NULL; struct rpc_pipe_client *result = NULL; + const char *pipe_name = NULL; req = tevent_req_create( mem_ctx, &state, struct rpc_pipe_open_np_state); @@ -3357,7 +3358,14 @@ struct tevent_req *rpc_pipe_open_np_send( result->max_xmit_frag = RPC_MAX_PDU_FRAG_LEN; - subreq = rpc_transport_np_init_send(state, ev, cli, table); + pipe_name = dcerpc_default_transport_endpoint(state, + NCACN_NP, + table); + if (tevent_req_nomem(pipe_name, req)) { + return tevent_req_post(req, ev); + } + + subreq = rpc_transport_np_init_send(state, ev, cli, pipe_name); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); } diff --git a/source3/rpc_client/rpc_transport.h b/source3/rpc_client/rpc_transport.h index f352f60cf2a..6c08860de17 100644 --- a/source3/rpc_client/rpc_transport.h +++ b/source3/rpc_client/rpc_transport.h @@ -84,7 +84,7 @@ struct cli_state; struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, - const struct ndr_interface_table *table); + const char *pipe_name); NTSTATUS rpc_transport_np_init_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, struct rpc_cli_transport **presult); diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c index 21266c37106..48ec425fee8 100644 --- a/source3/rpc_client/rpc_transport_np.c +++ b/source3/rpc_client/rpc_transport_np.c @@ -47,7 +47,7 @@ static void rpc_transport_np_init_pipe_open(struct tevent_req *subreq); struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev, struct cli_state *cli, - const struct ndr_interface_table *table) + const char *pipe_name) { struct tevent_req *req; struct rpc_transport_np_init_state *state; @@ -72,8 +72,7 @@ struct tevent_req *rpc_transport_np_init_send(TALLOC_CTX *mem_ctx, state->conn = cli->conn; state->timeout = cli->timeout; state->abs_timeout = timeval_current_ofs_msec(cli->timeout); - state->pipe_name = dcerpc_default_transport_endpoint(state, NCACN_NP, - table); + state->pipe_name = talloc_strdup(state, pipe_name); if (tevent_req_nomem(state->pipe_name, req)) { return tevent_req_post(req, ev); } diff --git a/source3/rpc_client/wsp_cli.c b/source3/rpc_client/wsp_cli.c index 992b1a83b2b..20c054c14ca 100644 --- a/source3/rpc_client/wsp_cli.c +++ b/source3/rpc_client/wsp_cli.c @@ -1831,7 +1831,6 @@ static NTSTATUS wsp_resp_pdu_complete(struct tstream_context *stream, } static NTSTATUS wsp_rpc_transport_np_connect(struct cli_state *cli, - const struct ndr_interface_table *table, TALLOC_CTX *mem_ctx, struct rpc_cli_transport **presult) { @@ -1843,7 +1842,7 @@ static NTSTATUS wsp_rpc_transport_np_connect(struct cli_state *cli, if (ev == NULL) { goto fail; } - req = rpc_transport_np_init_send(ev, ev, cli, table); + req = rpc_transport_np_init_send(ev, ev, cli, "MsFteWds"); if (req == NULL) { goto fail; } @@ -1897,7 +1896,6 @@ NTSTATUS wsp_server_connect(TALLOC_CTX *mem_ctx, } status = wsp_rpc_transport_np_connect(cli, - &ndr_table_msftewds, cli, &transport); if (!NT_STATUS_IS_OK(status)) {