removal of flag NO-ALIGN if a align flag is specified in pidl/ndr
Matthieu Patou
mat at samba.org
Thu Sep 8 02:48:58 MDT 2011
Hello,
I face a situation with ndr generated code when a top structure is
unaligned but one of its substructure can contain a security descriptor
that needs to have alignment.
I'm proposing the following change:
diff --git a/librpc/ndr/ndr.c b/librpc/ndr/ndr.c
index 7cb6e21..0094938 100644
--- a/librpc/ndr/ndr.c
+++ b/librpc/ndr/ndr.c
@@ -381,7 +381,7 @@ _PUBLIC_ void ndr_set_flags(uint32_t *pflags,
uint32_t new_flags)
(*pflags) &= ~LIBNDR_ALIGN_FLAGS;
}
if (new_flags & LIBNDR_ALIGN_FLAGS) {
- (*pflags) &= ~LIBNDR_FLAG_REMAINING;
+ (*pflags) &= ~(LIBNDR_FLAG_REMAINING|LIBNDR_FLAG_NOALIGN);
}
if (new_flags & LIBNDR_FLAG_NO_RELATIVE_REVERSE) {
(*pflags) &= ~LIBNDR_FLAG_RELATIVE_REVERSE;
Is there any remarks ?
Matthieu.
--
Matthieu Patou
Samba Team http://samba.org
Private repo http://git.samba.org/?p=mat/samba.git;a=summary
More information about the samba-technical
mailing list