pidl:Samba3/ServerNDR: correctly initialise ndr_push struct
authorStefan Metzmacher <metze@samba.org>
Tue, 25 Jan 2011 18:46:18 +0000 (19:46 +0100)
committerStefan Metzmacher <metze@samba.org>
Wed, 26 Jan 2011 07:51:46 +0000 (08:51 +0100)
We need to copy the ptr_count from the ndr_pull struct to the ndr_push struct,
otherwise we'll reuse full pointer ids, which will cause the client to
fail in the ndr unmarshalling.

metze

pidl/lib/Parse/Pidl/Samba3/ServerNDR.pm

index 0ebccf552cb185fefb2b78e3db538ad3253e42c7..64a4ec5aedeed19ab7112110755766d21e691bda 100644 (file)
@@ -199,6 +199,12 @@ sub ParseFunction($$)
        pidl "\treturn false;";
        pidl "}";
        pidl "";
+       pidl "/*";
+       pidl " * carry over the pointer count to the reply in case we are";
+       pidl " * using full pointer. See NDR specification for full pointers";
+       pidl " */";
+       pidl "push->ptr_count = pull->ptr_count;";
+       pidl "";
        pidl "ndr_err = call->ndr_push(push, NDR_OUT, r);";
        pidl "if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {";
        pidl "\ttalloc_free(r);";