summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_pipe.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-03-23 12:00:40 +0100
committerSimo Sorce <idra@samba.org>2010-07-07 23:45:50 -0400
commitd6de820480ce5db4b786a66886a5e255344acd43 (patch)
tree20a1cb5e2f8c011ed3f2590f0fff161c72567815 /source3/rpc_client/cli_pipe.c
parentcb9eddb31248f0c7b0ffcff642154ca4b0230276 (diff)
downloadsamba-d6de820480ce5db4b786a66886a5e255344acd43.tar.gz
samba-d6de820480ce5db4b786a66886a5e255344acd43.tar.bz2
samba-d6de820480ce5db4b786a66886a5e255344acd43.zip
s3-dcerpc: use dcerpc_pull_ncacn_packet() for pulling a RPC fault pdu.
Guenther Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3/rpc_client/cli_pipe.c')
-rw-r--r--source3/rpc_client/cli_pipe.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 5b3894c6ec..3d2362b64c 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -1140,27 +1140,25 @@ static NTSTATUS cli_pipe_validate_current_pdu(struct rpc_pipe_client *cli, RPC_H
case DCERPC_PKT_FAULT:
{
- RPC_HDR_RESP rhdr_resp;
- RPC_HDR_FAULT fault_resp;
+ DATA_BLOB blob;
+ struct ncacn_packet r;
- if(!smb_io_rpc_hdr_resp("rpc_hdr_resp", &rhdr_resp, current_pdu, 0)) {
- DEBUG(5,("cli_pipe_validate_current_pdu: failed to unmarshal RPC_HDR_RESP.\n"));
- return NT_STATUS_BUFFER_TOO_SMALL;
- }
+ blob = data_blob_const(prs_data_p(current_pdu),
+ prs_data_size(current_pdu));
- if(!smb_io_rpc_hdr_fault("fault", &fault_resp, current_pdu, 0)) {
- DEBUG(5,("cli_pipe_validate_current_pdu: failed to unmarshal RPC_HDR_FAULT.\n"));
- return NT_STATUS_BUFFER_TOO_SMALL;
+ ret = dcerpc_pull_ncacn_packet(cli, &blob, &r);
+ if (!NT_STATUS_IS_OK(ret)) {
+ return ret;
}
-
DEBUG(1, ("cli_pipe_validate_current_pdu: RPC fault "
"code %s received from %s!\n",
- dcerpc_errstr(talloc_tos(), NT_STATUS_V(fault_resp.status)),
+ dcerpc_errstr(talloc_tos(), r.u.fault.status),
rpccli_pipe_txt(talloc_tos(), cli)));
- if (NT_STATUS_IS_OK(fault_resp.status)) {
+
+ if (NT_STATUS_IS_OK(NT_STATUS(r.u.fault.status))) {
return NT_STATUS_UNSUCCESSFUL;
} else {
- return fault_resp.status;
+ return NT_STATUS(r.u.fault.status);
}
}