summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-06-08 03:48:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:57:07 -0500
commit04e07e8cc9d6615381e0501cd36cf7d78aeed189 (patch)
treeeb3bc33802854044b99618c9eeeff581f4c7ffd4 /source3/rpc_client
parent804415b5420b4022d588ab9a69bfb2b52f0fc0ec (diff)
downloadsamba-04e07e8cc9d6615381e0501cd36cf7d78aeed189.tar.gz
samba-04e07e8cc9d6615381e0501cd36cf7d78aeed189.tar.bz2
samba-04e07e8cc9d6615381e0501cd36cf7d78aeed189.zip
r7385: Rewrite the RPC bind parsing functions to follow the spec. I haven't yet
tested this so I may have screwed this up - however it now follows the DCE spec. valgrinded tests to follow.... Jeremy. (This used to be commit 877e0a61f5821c89149b1403d08675dd7db8039e)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_pipe.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 52cbae6326..8f6576a165 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -652,6 +652,7 @@ static NTSTATUS create_rpc_bind_req(struct cli_state *cli, prs_struct *rpc_out,
RPC_HDR hdr;
RPC_HDR_RB hdr_rb;
RPC_HDR_AUTH hdr_auth;
+ RPC_CONTEXT rpc_ctx;
int auth_len = 0;
int auth_type, auth_level;
size_t saved_hdr_offset = 0;
@@ -734,21 +735,25 @@ static NTSTATUS create_rpc_bind_req(struct cli_state *cli, prs_struct *rpc_out,
auth_len = prs_offset(&auth_info) - saved_hdr_offset;
}
+ /* create the RPC context. */
+ init_rpc_context(&rpc_ctx, 0 /* context id */,
+ abstract, transfer);
+
+ /* create the bind request RPC_HDR_RB */
+ init_rpc_hdr_rb(&hdr_rb, MAX_PDU_FRAG_LEN, MAX_PDU_FRAG_LEN, 0x0, &rpc_ctx);
+
/* Create the request RPC_HDR */
init_rpc_hdr(&hdr, RPC_BIND, 0x3, rpc_call_id,
- RPC_HEADER_LEN + RPC_HDR_RB_LEN + prs_offset(&auth_info),
+ RPC_HEADER_LEN + RPC_HDR_RB_LEN(&hdr_rb) + prs_offset(&auth_info),
auth_len);
+ /* Marshall the RPC header */
if(!smb_io_rpc_hdr("hdr" , &hdr, rpc_out, 0)) {
DEBUG(0,("create_rpc_bind_req: failed to marshall RPC_HDR.\n"));
prs_mem_free(&auth_info);
return NT_STATUS_NO_MEMORY;
}
- /* create the bind request RPC_HDR_RB */
- init_rpc_hdr_rb(&hdr_rb, MAX_PDU_FRAG_LEN, MAX_PDU_FRAG_LEN, 0x0,
- 0x1, 0x0, 0x1, abstract, transfer);
-
/* Marshall the bind request data */
if(!smb_io_rpc_hdr_rb("", &hdr_rb, rpc_out, 0)) {
DEBUG(0,("create_rpc_bind_req: failed to marshall RPC_HDR_RB.\n"));