From ae526514a936b46112845480646402fdd385d7a2 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 7 Jul 2010 17:14:27 -0400 Subject: s3:rpc user idl define dcerpc_ctx_list instead of custom RPC_CONTEXT --- source3/include/proto.h | 2 +- source3/include/rpc_dce.h | 9 +-------- source3/rpc_parse/parse_rpc.c | 15 +++++++++------ source3/rpc_server/srv_pipe.c | 22 +++++++++++++--------- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'source3') diff --git a/source3/include/proto.h b/source3/include/proto.h index 99afcf3e05..ec61dd1b9d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5078,7 +5078,7 @@ const char *get_pipe_name_from_syntax(TALLOC_CTX *mem_ctx, void init_rpc_hdr(RPC_HDR *hdr, enum dcerpc_pkt_type pkt_type, uint8 flags, uint32 call_id, int data_len, int auth_len); bool smb_io_rpc_hdr(const char *desc, RPC_HDR *rpc, prs_struct *ps, int depth); -bool smb_io_rpc_context(const char *desc, RPC_CONTEXT *rpc_ctx, prs_struct *ps, int depth); +bool smb_io_rpc_context(const char *desc, struct dcerpc_ctx_list *rpc_ctx, prs_struct *ps, int depth); bool smb_io_rpc_hdr_rb(const char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int depth); void init_rpc_hdr_ba(RPC_HDR_BA *rpc, uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid, diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h index 37015ebb96..03d1e32cca 100644 --- a/source3/include/rpc_dce.h +++ b/source3/include/rpc_dce.h @@ -107,18 +107,11 @@ typedef struct rpc_hdr_auth_info { #define RPC_HDR_AUTH_LEN 8 -typedef struct rpc_context { - uint16 context_id; /* presentation context identifier. */ - uint8 num_transfer_syntaxes; /* the number of syntaxes */ - struct ndr_syntax_id abstract; /* num and vers. of interface client is using */ - struct ndr_syntax_id *transfer; /* Array of transfer interfaces. */ -} RPC_CONTEXT; - /* RPC_BIND_REQ - ms req bind */ typedef struct rpc_bind_req_info { RPC_HDR_BBA bba; uint8 num_contexts; /* the number of contexts */ - RPC_CONTEXT *rpc_context; + struct dcerpc_ctx_list *rpc_context; } RPC_HDR_RB; /* diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c index eb52c41544..74246c5b4e 100644 --- a/source3/rpc_parse/parse_rpc.c +++ b/source3/rpc_parse/parse_rpc.c @@ -188,10 +188,10 @@ static bool smb_io_rpc_hdr_bba(const char *desc, RPC_HDR_BBA *rpc, prs_struct * } /******************************************************************* - Reads or writes an RPC_CONTEXT structure. + Reads or writes a struct dcerpc_ctx_list structure. ********************************************************************/ -bool smb_io_rpc_context(const char *desc, RPC_CONTEXT *rpc_ctx, prs_struct *ps, int depth) +bool smb_io_rpc_context(const char *desc, struct dcerpc_ctx_list *rpc_ctx, prs_struct *ps, int depth) { int i; @@ -209,17 +209,20 @@ bool smb_io_rpc_context(const char *desc, RPC_CONTEXT *rpc_ctx, prs_struct *ps, if (rpc_ctx->num_transfer_syntaxes == 0) return False; - if(!smb_io_rpc_iface("", &rpc_ctx->abstract, ps, depth)) + if(!smb_io_rpc_iface("", &rpc_ctx->abstract_syntax, ps, depth)) return False; if (UNMARSHALLING(ps)) { - if (!(rpc_ctx->transfer = PRS_ALLOC_MEM(ps, struct ndr_syntax_id, rpc_ctx->num_transfer_syntaxes))) { + rpc_ctx->transfer_syntaxes = + PRS_ALLOC_MEM(ps, struct ndr_syntax_id, + rpc_ctx->num_transfer_syntaxes); + if (!rpc_ctx->transfer_syntaxes) { return False; } } for (i = 0; i < rpc_ctx->num_transfer_syntaxes; i++ ) { - if (!smb_io_rpc_iface("", &rpc_ctx->transfer[i], ps, depth)) + if (!smb_io_rpc_iface("", &rpc_ctx->transfer_syntaxes[i], ps, depth)) return False; } return True; @@ -252,7 +255,7 @@ bool smb_io_rpc_hdr_rb(const char *desc, RPC_HDR_RB *rpc, prs_struct *ps, int de return False; if (UNMARSHALLING(ps)) { - if (!(rpc->rpc_context = PRS_ALLOC_MEM(ps, RPC_CONTEXT, rpc->num_contexts))) { + if (!(rpc->rpc_context = PRS_ALLOC_MEM(ps, struct dcerpc_ctx_list, rpc->num_contexts))) { return False; } } diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 6a40f32e23..e8a69a669f 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -1605,7 +1605,7 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p) * Try and find the correct pipe name to ensure * that this is a pipe name we support. */ - id = hdr_rb.rpc_context[0].abstract; + id = hdr_rb.rpc_context[0].abstract_syntax; if (rpc_srv_pipe_exists_by_id(&id)) { DEBUG(3, ("api_pipe_bind_req: \\PIPE\\%s -> \\PIPE\\%s\n", rpc_srv_get_pipe_cli_name(&id), @@ -1614,13 +1614,13 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p) status = smb_probe_module( "rpc", get_pipe_name_from_syntax( talloc_tos(), - &hdr_rb.rpc_context[0].abstract)); + &hdr_rb.rpc_context[0].abstract_syntax)); if (NT_STATUS_IS_ERR(status)) { DEBUG(3,("api_pipe_bind_req: Unknown pipe name %s in bind request.\n", get_pipe_name_from_syntax( talloc_tos(), - &hdr_rb.rpc_context[0].abstract))); + &hdr_rb.rpc_context[0].abstract_syntax))); prs_mem_free(&p->out_data.frag); prs_mem_free(&out_hdr_ba); prs_mem_free(&out_auth); @@ -1664,15 +1664,17 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p) unknown to NT4) Needed when adding entries to a DACL from NT5 - SK */ - if(check_bind_req(p, &hdr_rb.rpc_context[0].abstract, &hdr_rb.rpc_context[0].transfer[0], - hdr_rb.rpc_context[0].context_id )) { + if (check_bind_req(p, + &hdr_rb.rpc_context[0].abstract_syntax, + &hdr_rb.rpc_context[0].transfer_syntaxes[0], + hdr_rb.rpc_context[0].context_id)) { init_rpc_hdr_ba(&hdr_ba, RPC_MAX_PDU_FRAG_LEN, RPC_MAX_PDU_FRAG_LEN, assoc_gid, ack_pipe_name, 0x1, 0x0, 0x0, - &hdr_rb.rpc_context[0].transfer[0]); + &hdr_rb.rpc_context[0].transfer_syntaxes[0]); } else { /* Rejection reason: abstract syntax not supported */ init_rpc_hdr_ba(&hdr_ba, RPC_MAX_PDU_FRAG_LEN, @@ -1941,15 +1943,17 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p) unknown to NT4) Needed when adding entries to a DACL from NT5 - SK */ - if(check_bind_req(p, &hdr_rb.rpc_context[0].abstract, &hdr_rb.rpc_context[0].transfer[0], - hdr_rb.rpc_context[0].context_id )) { + if (check_bind_req(p, + &hdr_rb.rpc_context[0].abstract_syntax, + &hdr_rb.rpc_context[0].transfer_syntaxes[0], + hdr_rb.rpc_context[0].context_id)) { init_rpc_hdr_ba(&hdr_ba, RPC_MAX_PDU_FRAG_LEN, RPC_MAX_PDU_FRAG_LEN, assoc_gid, ack_pipe_name, 0x1, 0x0, 0x0, - &hdr_rb.rpc_context[0].transfer[0]); + &hdr_rb.rpc_context[0].transfer_syntaxes[0]); } else { /* Rejection reason: abstract syntax not supported */ init_rpc_hdr_ba(&hdr_ba, RPC_MAX_PDU_FRAG_LEN, -- cgit