Ethereal-dev: Re: [Ethereal-dev] [patch] fix for dissect_nt_sid

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Tim Potter <tpot@xxxxxxxxx>
Date: Mon, 28 Jan 2002 19:22:18 +1100
On Mon, Jan 28, 2002 at 02:19:57PM +1100, Ronnie Sahlberg wrote:

> 1, I do not think SMB mandates the same alignment rules as DCERPC , thus
> the 4byte alignment may break SMB use of this function.

The alignment "rules" for SMB packets are pretty haphazard, but seem to
follow the NDR representation most of the time (i.e align to next n-bytes
where n is the basic length of the type you are marshalling).  I did
find a packet last year (I think it was in the session setup or negprot
when you negotiated unicode strings) where a unicode string was *not*
aligned on a two-byte boundary.

> 2, DCERPC representation of the SID is slightly different from the SMB one,
> As I am sure you have noted, the DCERPC representation of the SID is
> prepended
> with an extra 32bit quantity which is the size of the conformant array
> inside the SID.

OK.  We can wrap this up in another function when we start running into
DCERPC SIDS.  This should crop up when I write some code for the printer
info 3 structure which contants a security descriptor.


Tim.