STEP03c: HACK s3:rpc_client: rpc_pipe_bind => dcerpc_do_bind_send/recv
authorStefan Metzmacher <metze@samba.org>
Thu, 9 Jan 2014 18:29:14 +0000 (19:29 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 4 Jun 2019 10:45:39 +0000 (12:45 +0200)
source3/rpc_client/cli_pipe.c

index 0813ba1c9e21f1824adfb596d12212f3971be662..9dff4250539e211ac6178c831c8d09d159166b72 100644 (file)
@@ -2129,8 +2129,10 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
 {
        TALLOC_CTX *frame = talloc_stackframe();
        struct tevent_context *ev;
-       struct tevent_req *req;
        NTSTATUS status = NT_STATUS_OK;
+       struct dcerpc_call *call;
+       struct tevent_req *subreq;
+       struct dcerpc_presentation *pres[1];
 
        ev = samba_tevent_context_init(frame);
        if (ev == NULL) {
@@ -2138,17 +2140,23 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
                goto fail;
        }
 
-       req = rpc_pipe_bind_send(frame, ev, cli, auth);
-       if (req == NULL) {
+       call = dcerpc_call_allocate(frame, cli->assoc, NULL, NULL);
+
+       pres[0] = cli->pres;
+
+       subreq = dcerpc_do_bind_send(frame, ev, cli->conn, call,
+                                    cli->sec, ARRAY_SIZE(pres), pres);
+
+       if (subreq == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto fail;
        }
 
-       if (!tevent_req_poll_ntstatus(req, ev, &status)) {
+       if (!tevent_req_poll_ntstatus(subreq, ev, &status)) {
                goto fail;
        }
 
-       status = rpc_pipe_bind_recv(req);
+       status = dcerpc_do_bind_recv(subreq);
  fail:
        TALLOC_FREE(frame);
        return status;