s4:rpc_server: return the context_id of a RESPONSE in the 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 bece779f5e4e08d9c2549beb127e516ba8cb091e..ef2906e07242ad8f2b2bddb8577206adc91bb468 100644 (file)
@@ -234,7 +234,13 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state *call)
                        pkt.pfc_flags |= DCERPC_PFC_FLAG_LAST;
                }
                pkt.u.response.alloc_hint = stub.length;
-               pkt.u.response.context_id = call->pkt.u.request.context_id;
+               /*
+                * bug for bug, feature for feature...
+                *
+                * Windows truncates the context_id with & 0xFF,
+                * so we do.
+                */
+               pkt.u.response.context_id = context->context_id & 0xFF;
                pkt.u.response.cancel_count = 0;
                pkt.u.response.stub_and_verifier.data = stub.data;
                pkt.u.response.stub_and_verifier.length = length;