summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/libndr.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-07-04 15:42:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:13 -0500
commit148235a00948d572e863db277704c34fee56ebf4 (patch)
tree9b802d3466b1db98b129ac194d144653b939b621 /source4/librpc/ndr/libndr.h
parent8f9e87d858ae1cf2209cfd8332ad54a750252e24 (diff)
downloadsamba-148235a00948d572e863db277704c34fee56ebf4.tar.gz
samba-148235a00948d572e863db277704c34fee56ebf4.tar.bz2
samba-148235a00948d572e863db277704c34fee56ebf4.zip
r8148: - make the PAC generation code a bit more readable and add some outof memory checks
- move to handmodified pull/push code for PAC_BUFFER to get the _ndr_size field and the subcontext size right - after looking closely to the sample w2k3 PAC in our torture test (and some more in my archive) I found out that the first uint32 before the netr_SamInfo3 was also a pointer, (and we passed a NULL pointer there before, so I think that was the reason why the windows clients doesn't want our PAC) w2k3 uses this for unique pointers: ptr = ndr->ptr_count * 4; ptr |= 0x00020000; ndr->ptr_count; - do one more pull/push round with the sample PAC metze (This used to be commit 0eee17941595e9842a264bf89ac73ca66cea7ed5)
Diffstat (limited to 'source4/librpc/ndr/libndr.h')
-rw-r--r--source4/librpc/ndr/libndr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index 17c06b79da..328fa7c703 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -191,6 +191,8 @@ enum ndr_compression_alg {
#define NDR_ALIGN(ndr, n) ndr_align_size(ndr->offset, n)
+#define NDR_ROUND(size, n) (((size)+((n)-1)) & ~((n)-1))
+
#define NDR_PULL_ALIGN(ndr, n) do { \
if (!(ndr->flags & LIBNDR_FLAG_NOALIGN)) { \
if (ndr->flags & LIBNDR_FLAG_PAD_CHECK) { \