summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2012-05-25 09:16:50 -0700
committerJeremy Allison <jra@samba.org>2012-05-25 09:16:50 -0700
commit035342c11719d1daa647c0b2ae7cec27a969f83a (patch)
treeba5ead9220adf3999d1dffb08f0a146d8476a4f3 /librpc/ndr
parente17fa58d6ee8bf190adba25462d9d97b26ca2c8f (diff)
downloadsamba-035342c11719d1daa647c0b2ae7cec27a969f83a.tar.gz
samba-035342c11719d1daa647c0b2ae7cec27a969f83a.tar.bz2
samba-035342c11719d1daa647c0b2ae7cec27a969f83a.zip
Fix bug #8373 - Can't join XP Pro workstations to 3.6.1 DC.
Treat LIBNDR_FLAG_NOALIGN and LIBNDR_FLAG_REMAINING the same as the other align flags - make them mutually exclusive. Combined work from Metze, Günther and Jeremy.
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/libndr.h8
-rw-r--r--librpc/ndr/ndr.c8
2 files changed, 11 insertions, 5 deletions
diff --git a/librpc/ndr/libndr.h b/librpc/ndr/libndr.h
index 37a3145e12..1bd284f798 100644
--- a/librpc/ndr/libndr.h
+++ b/librpc/ndr/libndr.h
@@ -135,7 +135,13 @@ struct ndr_print {
#define LIBNDR_FLAG_ALIGN4 (1<<23)
#define LIBNDR_FLAG_ALIGN8 (1<<24)
-#define LIBNDR_ALIGN_FLAGS (LIBNDR_FLAG_ALIGN2|LIBNDR_FLAG_ALIGN4|LIBNDR_FLAG_ALIGN8)
+#define LIBNDR_ALIGN_FLAGS ( 0 | \
+ LIBNDR_FLAG_NOALIGN | \
+ LIBNDR_FLAG_REMAINING | \
+ LIBNDR_FLAG_ALIGN2 | \
+ LIBNDR_FLAG_ALIGN4 | \
+ LIBNDR_FLAG_ALIGN8 | \
+ 0)
#define LIBNDR_PRINT_ARRAY_HEX (1<<25)
#define LIBNDR_PRINT_SET_VALUES (1<<26)
diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c
index 2279d1c1c3..b77bfae36b 100644
--- a/librpc/ndr/ndr.c
+++ b/librpc/ndr/ndr.c
@@ -378,11 +378,11 @@ _PUBLIC_ void ndr_set_flags(uint32_t *pflags, uint32_t new_flags)
(*pflags) &= ~LIBNDR_FLAG_LITTLE_ENDIAN;
(*pflags) &= ~LIBNDR_FLAG_NDR64;
}
- if (new_flags & LIBNDR_FLAG_REMAINING) {
- (*pflags) &= ~LIBNDR_ALIGN_FLAGS;
- }
if (new_flags & LIBNDR_ALIGN_FLAGS) {
- (*pflags) &= ~LIBNDR_FLAG_REMAINING;
+ /* Ensure we only have the passed-in
+ align flag set in the new_flags,
+ remove any old align flag. */
+ (*pflags) &= ~LIBNDR_ALIGN_FLAGS;
}
if (new_flags & LIBNDR_FLAG_NO_RELATIVE_REVERSE) {
(*pflags) &= ~LIBNDR_FLAG_RELATIVE_REVERSE;