diff options
Diffstat (limited to 'source3/rpc_server/srv_pipe_hnd.c')
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 101 |
1 files changed, 0 insertions, 101 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 0ac9072f3e..cf7fe75f63 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -145,107 +145,6 @@ static bool get_pdu_size(pipes_struct *p) } /**************************************************************************** - Unmarshalls a new PDU header. Assumes the raw header data is in current pdu. -****************************************************************************/ - -static bool unmarshall_rpc_header(pipes_struct *p) -{ - /* - * Unmarshall the header to determine the needed length. - */ - - prs_struct rpc_in; - - prs_init_empty( &rpc_in, p->mem_ctx, UNMARSHALL); - prs_set_endian_data( &rpc_in, p->endian); - - prs_give_memory( &rpc_in, (char *)&p->in_data.pdu.data[0], - p->in_data.pdu.length, False); - - /* - * Unmarshall the header. - * This also sets the endian flag in rpc_in. - */ - - if(!smb_io_rpc_hdr("", &p->hdr, &rpc_in, 0)) { - DEBUG(0, ("unmarshall_rpc_header: " - "failed to unmarshall RPC_HDR.\n")); - set_incoming_fault(p); - prs_mem_free(&rpc_in); - return false; - } - - /* - * Validate the RPC header. - */ - - if(p->hdr.major != 5 && p->hdr.minor != 0) { - DEBUG(0, ("unmarshall_rpc_header: " - "invalid major/minor numbers in RPC_HDR.\n")); - set_incoming_fault(p); - prs_mem_free(&rpc_in); - return false; - } - - /* - * If there's not data in the incoming buffer this should be the - * start of a new RPC. - */ - - if(prs_offset(&p->in_data.data) == 0) { - - /* - * AS/U doesn't set FIRST flag in a BIND packet it seems. - */ - - if ((p->hdr.pkt_type == DCERPC_PKT_REQUEST) && - !(p->hdr.flags & DCERPC_PFC_FLAG_FIRST)) { - /* - * Ensure that the FIRST flag is set. - * If not then we have a stream missmatch. - */ - - DEBUG(0, ("unmarshall_rpc_header: " - "FIRST flag not set in first PDU !\n")); - set_incoming_fault(p); - prs_mem_free(&rpc_in); - return false; - } - - /* - * If this is the first PDU then set the endianness - * flag in the pipe. We will need this when parsing all - * data in this RPC. - */ - - p->endian = rpc_in.bigendian_data; - - DEBUG(5, ("unmarshall_rpc_header: using %sendian RPC\n", - p->endian == RPC_LITTLE_ENDIAN ? "little-" : "big-" )); - - } else { - - /* - * If this is *NOT* the first PDU then check the endianness - * flag in the pipe is the same as that in the PDU. - */ - - if (p->endian != rpc_in.bigendian_data) { - DEBUG(0, ("unmarshall_rpc_header: FIRST endianness " - "flag (%d) different in next PDU !\n", - (int)p->endian)); - set_incoming_fault(p); - prs_mem_free(&rpc_in); - return false; - } - } - - DEBUG(10, ("unmarshall_rpc_header: type = %u, flags = %u\n", - (unsigned int)p->hdr.pkt_type, (unsigned int)p->hdr.flags)); - return true; -} - -/**************************************************************************** Call this to free any talloc'ed memory. Do this after processing a complete incoming and outgoing request (multiple incoming/outgoing PDU's). |