s4:irpc: use LIBNDR_FLAG_REF_ALLOC for the server side when pulling
authorStefan Metzmacher <metze@samba.org>
Thu, 23 Sep 2010 02:04:58 +0000 (19:04 -0700)
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Thu, 23 Sep 2010 15:41:05 +0000 (08:41 -0700)
The dcerpc server also uses it, so it was surprising that the
IRPC server side doesn't used it.

The reason to have this is that we want to handle error cases
and returns like NT_STATUS_NOT_SUPPORTED sane, without crashing
while marshalling the response.

metze

Signed-off-by: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
source4/lib/messaging/messaging.c

index d880c6336f057b33077f14252961b3239ef55690..724d66af685b71c51479e4b5fee34fc88a92b4f9 100644 (file)
@@ -769,6 +769,8 @@ static void irpc_handler_request(struct messaging_context *msg_ctx,
        r = talloc_zero_size(m->ndr, i->table->calls[m->header.callnum].struct_size);
        if (r == NULL) goto failed;
 
+       m->ndr->flags |= LIBNDR_FLAG_REF_ALLOC;
+
        /* parse the request data */
        ndr_err = i->table->calls[i->callnum].ndr_pull(m->ndr, NDR_IN, r);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) goto failed;