s3:rpc_client: pass object and table to rpccli_bh_create()
authorStefan Metzmacher <metze@samba.org>
Tue, 27 Aug 2013 11:23:04 +0000 (13:23 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Oct 2013 19:48:45 +0000 (08:48 +1300)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_client/cli_pipe.c
source3/rpc_client/cli_pipe.h
source3/rpc_server/rpc_ncacn_np.c

index 59dc7b6dc2a967f0feeadddbdc458ffb65586767..48ed92ce50a1faf1b7ff82cc564303e1ba1e8f16 100644 (file)
@@ -2048,15 +2048,17 @@ static const struct dcerpc_binding_handle_ops rpccli_bh_ops = {
 };
 
 /* initialise a rpc_pipe_client binding handle */
-struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c)
+struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c,
+                                       const struct GUID *object,
+                                       const struct ndr_interface_table *table)
 {
        struct dcerpc_binding_handle *h;
        struct rpccli_bh_state *hs;
 
        h = dcerpc_binding_handle_create(c,
                                         &rpccli_bh_ops,
-                                        NULL,
-                                        NULL, /* TODO */
+                                        object,
+                                        table,
                                         &hs,
                                         struct rpccli_bh_state,
                                         __location__);
@@ -2252,7 +2254,7 @@ static NTSTATUS rpc_pipe_open_tcp_port(TALLOC_CTX *mem_ctx, const char *host,
 
        result->transport->transport = NCACN_IP_TCP;
 
-       result->binding_handle = rpccli_bh_create(result);
+       result->binding_handle = rpccli_bh_create(result, NULL, table);
        if (result->binding_handle == NULL) {
                TALLOC_FREE(result);
                return NT_STATUS_NO_MEMORY;
@@ -2491,7 +2493,7 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
 
        result->transport->transport = NCALRPC;
 
-       result->binding_handle = rpccli_bh_create(result);
+       result->binding_handle = rpccli_bh_create(result, NULL, table);
        if (result->binding_handle == NULL) {
                TALLOC_FREE(result);
                return NT_STATUS_NO_MEMORY;
@@ -2582,7 +2584,7 @@ static NTSTATUS rpc_pipe_open_np(struct cli_state *cli,
        DLIST_ADD(np_ref->cli->pipe_list, np_ref->pipe);
        talloc_set_destructor(np_ref, rpc_pipe_client_np_ref_destructor);
 
-       result->binding_handle = rpccli_bh_create(result);
+       result->binding_handle = rpccli_bh_create(result, NULL, table);
        if (result->binding_handle == NULL) {
                TALLOC_FREE(result);
                return NT_STATUS_NO_MEMORY;
index ab993739b272b46dc2e83ae2d462dc390cfa4844..e38767d5daa0591b9e49c4279bc814c657633de7 100644 (file)
@@ -68,7 +68,9 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const char *socket_path,
                               const struct ndr_interface_table *table,
                               struct rpc_pipe_client **presult);
 
-struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c);
+struct dcerpc_binding_handle *rpccli_bh_create(struct rpc_pipe_client *c,
+                                       const struct GUID *object,
+                                       const struct ndr_interface_table *table);
 
 NTSTATUS cli_rpc_pipe_open_noauth(struct cli_state *cli,
                                  const struct ndr_interface_table *table,
index 9c1599ecf4adf0973aeeee65c0057fe6de88c2d2..c58f97dec9879fe5131c6d792df993c0a82f5b10 100644 (file)
@@ -640,7 +640,7 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx,
 
 static NTSTATUS rpc_pipe_open_external(TALLOC_CTX *mem_ctx,
                                const char *pipe_name,
-                               const struct ndr_syntax_id *abstract_syntax,
+                               const struct ndr_interface_table *table,
                                const struct auth_session_info *session_info,
                                struct rpc_pipe_client **_result)
 {
@@ -675,7 +675,7 @@ static NTSTATUS rpc_pipe_open_external(TALLOC_CTX *mem_ctx,
                goto done;
        }
 
-       result->abstract_syntax = *abstract_syntax;
+       result->abstract_syntax = table->syntax_id;
        result->transfer_syntax = ndr_transfer_syntax_ndr;
 
        result->desthost = get_myname(result);
@@ -696,7 +696,7 @@ static NTSTATUS rpc_pipe_open_external(TALLOC_CTX *mem_ctx,
                goto done;
        }
 
-       result->binding_handle = rpccli_bh_create(result);
+       result->binding_handle = rpccli_bh_create(result, NULL, table);
        if (result->binding_handle == NULL) {
                status = NT_STATUS_NO_MEMORY;
                DEBUG(0, ("Failed to create binding handle.\n"));
@@ -821,7 +821,7 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
                 * to spoolssd. */
 
                status = rpc_pipe_open_external(tmp_ctx,
-                                               pipe_name, &table->syntax_id,
+                                               pipe_name, table,
                                                session_info,
                                                &cli);
                if (!NT_STATUS_IS_OK(status)) {