From b0cc0d5698d34aa7956b22faa8b79bd9b338286d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 1 Nov 2012 13:42:52 +1100 Subject: [PATCH] s4-librpc: set error code to LOGON_FAILURE on RPC fault with access denied this allows the client code to trigger a retry with a new password callback for NTLM connections Pair-Programmed-With: Andrew Bartlett --- source4/librpc/rpc/dcerpc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index 4440395e94ec..e653cbaea69a 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -2148,8 +2148,13 @@ static void dcerpc_alter_context_recv_handler(struct rpc_request *subreq, if (pkt->ptype == DCERPC_PKT_FAULT) { DEBUG(5,("dcerpc: alter_resp - rpc fault: %s\n", dcerpc_errstr(state, pkt->u.fault.status))); - state->p->last_fault_code = pkt->u.fault.status; - tevent_req_nterror(req, NT_STATUS_NET_WRITE_FAULT); + if (pkt->u.fault.status == DCERPC_FAULT_ACCESS_DENIED) { + state->p->last_fault_code = pkt->u.fault.status; + tevent_req_nterror(req, NT_STATUS_LOGON_FAILURE); + } else { + state->p->last_fault_code = pkt->u.fault.status; + tevent_req_nterror(req, NT_STATUS_NET_WRITE_FAULT); + } return; } -- 2.34.1