summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-04-09 13:27:07 +0200
committerStefan Metzmacher <metze@samba.org>2010-04-09 16:28:30 +0200
commite95e2e82624eab72c1ae913b9b2b00412c91802e (patch)
tree420c1aee08b8bdc6bf9a3304669c10549e00e53b
parent718a8046138355defbbf0f5b42502b1cc7fd801a (diff)
downloadsamba-e95e2e82624eab72c1ae913b9b2b00412c91802e.tar.gz
samba-e95e2e82624eab72c1ae913b9b2b00412c91802e.tar.bz2
samba-e95e2e82624eab72c1ae913b9b2b00412c91802e.zip
s4:librpc/rpc: correctly initialize last_fault_code for bind and alter_context requests
metze
-rw-r--r--source4/librpc/rpc/dcerpc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index 064159f354..95f83465fc 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -611,6 +611,7 @@ static void dcerpc_bind_recv_handler(struct rpc_request *req,
if ((pkt->ptype != DCERPC_PKT_BIND_ACK) ||
(pkt->u.bind_ack.num_results == 0) ||
(pkt->u.bind_ack.ctx_list[0].result != 0)) {
+ req->p->last_fault_code = DCERPC_NCA_S_PROTO_ERROR;
composite_error(c, NT_STATUS_NET_WRITE_FAULT);
return;
}
@@ -1584,9 +1585,17 @@ static void dcerpc_alter_recv_handler(struct rpc_request *req,
return;
}
+ if (pkt->ptype == DCERPC_PKT_FAULT) {
+ DEBUG(5,("rpc fault: %s\n", dcerpc_errstr(c, pkt->u.fault.status)));
+ recv_pipe->last_fault_code = pkt->u.fault.status;
+ composite_error(c, NT_STATUS_NET_WRITE_FAULT);
+ return;
+ }
+
if (pkt->ptype != DCERPC_PKT_ALTER_RESP ||
pkt->u.alter_resp.num_results == 0 ||
pkt->u.alter_resp.ctx_list[0].result != 0) {
+ recv_pipe->last_fault_code = DCERPC_NCA_S_PROTO_ERROR;
composite_error(c, NT_STATUS_NET_WRITE_FAULT);
return;
}