s4:rpc_server: return the context_id of a RESPONSE in the same way as windows
[sfrench/samba-autobuild/.git] / 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;