]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpc_client: only pass the pipe_name to rpc_transport_np_init_send()
authorStefan Metzmacher <metze@samba.org>
Thu, 19 Sep 2024 22:24:05 +0000 (00:24 +0200)
committerJule Anger <janger@samba.org>
Thu, 12 Jun 2025 11:27:15 +0000 (11:27 +0000)
There's no need to have the ndr_interface_table at that stage...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 5b3573135b222755cd897d4539c0e5a89f7cdf5b)

source3/rpc_client/cli_pipe.c
source3/rpc_client/rpc_transport.h
source3/rpc_client/rpc_transport_np.c
source3/rpc_client/wsp_cli.c

index b2588da57cafa41487ca7ff82c3d8faf83d35f43..86e437754f9ec07c07fa31145f43d6b23e258820 100644 (file)
@@ -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);
        }
index f352f60cf2a4f323e7b27666f57310e4290e0008..6c08860de17b386bcd66b9c95b4b1e154c7f4647 100644 (file)
@@ -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);
index 21266c37106192749d5ee72ba283399858daad8d..48ec425fee854d27dc0587ec72b1fbb38a903d5e 100644 (file)
@@ -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);
        }
index 992b1a83b2ba78bfe528222fc7c51f08dfd6981f..20c054c14ca37de9900ec40565ca44c1b151953e 100644 (file)
@@ -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)) {