r10141: if some of the LIBNDR_ALIGN_* flags and LIBNDR_FLAG_REMAINING are set,
authorStefan Metzmacher <metze@samba.org>
Sat, 10 Sep 2005 08:46:28 +0000 (08:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:38:02 +0000 (13:38 -0500)
ndr_pull_data_blob() doesn't work correct. so make them exclute each other.

jelmer, tridge: does that look correct? it fixes a problem, abartlet had
with krb5pac.idl, where the align flags are inherited from the parent, and we want to get the
[flag(NDR_REMAINING)] DATA_BLOB signature;

metze

source/librpc/ndr/ndr.c

index 6bc4198de1d51a39268acb6327ba7c99f4d2bb13..2e6fd5b432b5780e2778129e87c550184ba49409 100644 (file)
@@ -246,6 +246,12 @@ void ndr_set_flags(uint32_t *pflags, uint32_t new_flags)
        if (new_flags & LIBNDR_FLAG_BIGENDIAN) {
                (*pflags) &= ~LIBNDR_FLAG_LITTLE_ENDIAN;
        }
+       if (new_flags & LIBNDR_FLAG_REMAINING) {
+               (*pflags) &= ~LIBNDR_ALIGN_FLAGS;
+       }
+       if (new_flags & LIBNDR_ALIGN_FLAGS) {
+               (*pflags) &= ~LIBNDR_FLAG_REMAINING;
+       }
        (*pflags) |= new_flags;
 }