s4:rpc_server: return the context_id of a FAULT in a same way as windows
authorStefan Metzmacher <metze@samba.org>
Tue, 13 Sep 2016 23:17:19 +0000 (01:17 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 26 Oct 2016 09:20:17 +0000 (11:20 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source4/rpc_server/common/reply.c

index a24fc6430befca0df30ce25f4c3faf8780ada19d..bece779f5e4e08d9c2549beb127e516ba8cb091e 100644 (file)
@@ -112,22 +112,10 @@ NTSTATUS dcesrv_fault_with_flags(struct dcesrv_call_state *call,
        pkt.ptype = DCERPC_PKT_FAULT;
        pkt.pfc_flags = DCERPC_PFC_FLAG_FIRST | DCERPC_PFC_FLAG_LAST | extra_flags;
        pkt.u.fault.alloc_hint = 24;
-       switch (call->pkt.ptype) {
-       case DCERPC_PKT_REQUEST:
-               pkt.u.fault.context_id = call->pkt.u.request.context_id;
-               break;
-       default:
-               pkt.u.fault.context_id = 0;
-               break;
-       }
-       switch (fault_code) {
-       case DCERPC_NCA_S_PROTO_ERROR:
-       case DCERPC_NCA_S_UNKNOWN_IF:
-               /*
-                * context_id = 0 is forced on protocol errors.
-                */
+       if (call->context != NULL) {
+               pkt.u.fault.context_id = call->context->context_id;
+       } else {
                pkt.u.fault.context_id = 0;
-               break;
        }
        pkt.u.fault.cancel_count = 0;
        pkt.u.fault.flags = 0;