diff options
author | Simo Sorce <idra@samba.org> | 2010-07-16 15:15:48 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-07-16 16:02:39 -0400 |
commit | 65116adcebe23d3ae42a641515f6001268ed0ef0 (patch) | |
tree | e9becdcf344e99d893bcb1dc07709b967a7ea34b /source3/rpc_server/srv_pipe_hnd.c | |
parent | ec25a000317f863df7af0d97f1fd8948b2f8959d (diff) | |
download | samba-65116adcebe23d3ae42a641515f6001268ed0ef0.tar.gz samba-65116adcebe23d3ae42a641515f6001268ed0ef0.tar.bz2 samba-65116adcebe23d3ae42a641515f6001268ed0ef0.zip |
s3-dcerpc: Fix ability to receive Big Endian PDUs
Diffstat (limited to 'source3/rpc_server/srv_pipe_hnd.c')
-rw-r--r-- | source3/rpc_server/srv_pipe_hnd.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c index 3055e1a29c..51f30cea25 100644 --- a/source3/rpc_server/srv_pipe_hnd.c +++ b/source3/rpc_server/srv_pipe_hnd.c @@ -406,25 +406,27 @@ static void process_complete_pdu(pipes_struct *p) goto done; } - status = dcerpc_pull_ncacn_packet(pkt, &p->in_data.pdu, pkt); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(0, ("Failed to unmarshal rpc packet: %s!\n", - nt_errstr(status))); - goto done; - } - - /* Store the call_id */ - p->call_id = pkt->call_id; - /* * Ensure we're using the corrent endianness for both the * RPC header flags and the raw data we will be reading from. */ - if (pkt->drep[0] == DCERPC_DREP_LE) { + if (dcerpc_get_endian_flag(&p->in_data.pdu) & DCERPC_DREP_LE) { p->endian = RPC_LITTLE_ENDIAN; } else { p->endian = RPC_BIG_ENDIAN; } + DEBUG(10, ("PDU is in %s Endian format!\n", p->endian?"Big":"Little")); + + status = dcerpc_pull_ncacn_packet(pkt, &p->in_data.pdu, + pkt, p->endian); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Failed to unmarshal rpc packet: %s!\n", + nt_errstr(status))); + goto done; + } + + /* Store the call_id */ + p->call_id = pkt->call_id; DEBUG(10, ("Processing packet type %d\n", (int)pkt->ptype)); |