HACK: s3:rpc_client: multiple dcerpc_presentations, only one wins.
authorStefan Metzmacher <metze@samba.org>
Sat, 11 Jan 2014 08:51:14 +0000 (09:51 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 10 Feb 2014 08:05:11 +0000 (09:05 +0100)
source3/rpc_client/cli_pipe.c
source3/rpc_client/rpc_client.h

index dd48d501cc967e7a5148fd3530dfde75f965e707..2556918b4960cbe24671510ebeafcd02c8a39801 100644 (file)
@@ -23,6 +23,8 @@
 #include "../lib/util/tevent_ntstatus.h"
 #include "librpc/gen_ndr/ndr_epmapper_c.h"
 #include "../librpc/gen_ndr/ndr_dssetup.h"
+#include "../librpc/gen_ndr/ndr_mgmt.h"
+#include "../librpc/gen_ndr/ndr_dnsserver.h"
 #include "../libcli/auth/schannel.h"
 #include "../libcli/auth/netlogon_creds_cli.h"
 #include "auth_generic.h"
@@ -2019,7 +2021,7 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
        NTSTATUS status = NT_STATUS_OK;
        struct dcerpc_call *call;
        struct tevent_req *subreq;
-       struct dcerpc_presentation *pres[1];
+       struct dcerpc_presentation *pres[4];
 
        ev = samba_tevent_context_init(frame);
        if (ev == NULL) {
@@ -2034,7 +2036,17 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
 
        call = dcerpc_call_allocate(frame, cli->assoc, NULL, NULL);
 
-       pres[0] = cli->pres;
+       pres[1] = cli->pres;
+       pres[0] = dcerpc_presentation_allocate(frame, cli->conn,
+                                              cli->table,
+                                              &ndr_table_mgmt.syntax_id);
+                                              //&ndr_transfer_syntax_ndr64);
+       pres[2] = dcerpc_presentation_allocate(frame, cli->conn,
+                                              &ndr_table_mgmt,
+                                              &ndr_transfer_syntax_ndr);
+       pres[3] = dcerpc_presentation_allocate(frame, cli->conn,
+                                              &ndr_table_dnsserver,
+                                              &ndr_transfer_syntax_ndr64);
 
        subreq = dcerpc_do_bind_send(frame, ev, cli->conn, call,
                                     cli->sec, ARRAY_SIZE(pres), pres);
@@ -2349,6 +2361,8 @@ struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c,
        struct dcerpc_binding_handle *h;
        struct rpccli_bh_state *hs;
 
+       c->table = table;
+
        h = dcerpc_binding_handle_create(c,
                                         &rpccli_bh_ops,
                                         object,
index 186696c5dd4db1fdb746c720aee9de1df26c59ba..63638a08288b5e3f1ac37bf49f37dcedd8807071 100644 (file)
@@ -39,6 +39,7 @@ struct rpc_pipe_client {
 
        struct ndr_syntax_id abstract_syntax;
        struct ndr_syntax_id transfer_syntax;
+       const struct ndr_interface_table *table;
        bool verified_pcontext;
 
        struct dcerpc_association *assoc;