removal of flag NO-ALIGN if a align flag is specified in pidl/ndr

Matthieu Patou mat at samba.org
Thu Sep 8 10:30:59 MDT 2011


On 08/09/2011 17:57, Stefan (metze) Metzmacher wrote:
> Am 08.09.2011 10:48, schrieb Matthieu Patou:
>> 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 ?
> What about this patches:
> http://gitweb.samba.org/?p=metze/samba/wip.git;a=shortlog;h=e9148f683326ab8a2a0ce8d083b7cb6ab0a5ae58
Why not, which tests do you plan to do ?

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