s4-librpc: set error code to LOGON_FAILURE on RPC fault with access denied
authorAndrew Tridgell <tridge@samba.org>
Thu, 1 Nov 2012 02:42:52 +0000 (13:42 +1100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 1 Nov 2012 04:40:41 +0000 (15:40 +1100)
this allows the client code to trigger a retry with a new password
callback for NTLM connections

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

source4/librpc/rpc/dcerpc.c

index 4440395e94ecf6e95759b1eb087e80695f156294..e653cbaea69ac37ff7484c805f25b404da8a128a 100644 (file)
@@ -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;
        }