summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-08-04 05:59:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:57:46 -0500
commit60708de658f0b80f7322489a0b6e0c5b9c76a60b (patch)
tree236b18085daf1c302812cfdf571c9dca9a671617 /source4/librpc
parentd31150a34f1b07b543aa26074d761ef9371576af (diff)
downloadsamba-60708de658f0b80f7322489a0b6e0c5b9c76a60b.tar.gz
samba-60708de658f0b80f7322489a0b6e0c5b9c76a60b.tar.bz2
samba-60708de658f0b80f7322489a0b6e0c5b9c76a60b.zip
r1644: changed the way [relative] pointers work in pidl, making them much
simpler. This doesn't appear to hurt any of the existing uses of [relative], but fixes its use for svcctl that jelmer is working on. (This used to be commit 573f56a44785526d15c0179c5bbdab4c8b9461f1)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/ndr/ndr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr.c b/source4/librpc/ndr/ndr.c
index d2e85f6aec..881a4ab60f 100644
--- a/source4/librpc/ndr/ndr.c
+++ b/source4/librpc/ndr/ndr.c
@@ -661,7 +661,15 @@ NTSTATUS ndr_pull_relative(struct ndr_pull *ndr, const void **buf, size_t size,
return NT_STATUS_OK;
}
ndr_pull_save(ndr, &save);
+ /* the old way of handling relative pointers appears to be
+ wrong, and there doesn't seem to be anything relying on it,
+ but I am keeping the code around in case I missed a
+ critical use for it (tridge, august 2004) */
+#if OLD_RELATIVE_BEHAVIOUR
NDR_CHECK(ndr_pull_set_offset(ndr, ofs + ndr->ofs_list->offset));
+#else
+ NDR_CHECK(ndr_pull_set_offset(ndr, ofs));
+#endif
NDR_CHECK(ndr_pull_subcontext(ndr, &ndr2, ndr->data_size - ndr->offset));
/* strings must be allocated by the backend functions */
if (ndr->flags & LIBNDR_STRING_FLAGS) {
@@ -690,7 +698,11 @@ NTSTATUS ndr_push_relative(struct ndr_push *ndr, int ndr_flags, const void *p,
NDR_PUSH_ALLOC(ndr, ofs);
NDR_CHECK(ndr_push_align(ndr, 4));
ofs->offset = ndr->offset;
+#if OLD_RELATIVE_BEHAVIOUR
ofs->base = ndr->ofs_list->offset;
+#else
+ ofs->base = 0;
+#endif
NDR_CHECK(ndr_push_uint32(ndr, 0xFFFFFFFF));
ofs->next = NULL;
if (ndr->relative_list_end) {