[jcifs] Re: Problems with implementing LsarLookupSids()

Michael B Allen mba2000 at ioplex.com
Fri Dec 10 23:37:01 GMT 2004


On Fri, 10 Dec 2004 23:23:52 +0100
Ralf Hartmann <Ralf.Hartmann at xsystem.de> wrote:

> I am still wondering about the two additional bytes behind sid_type in 
> lsa_TranslatedName. It looks like an alignment. Maybe an unicode string
> has to be started at 4 byte boundary.

Yes, I believe you have stumbled on a bug. Normally alignment is handled
within the enc_ndr_/dec_ndr_ methods. If you look at
NdrBuffer.enc_ndr_string you'll see it begins with 'align(4)'. Unfortunately
because the string is embedded the code is inlined. Therefore the alignment
is not applied. This is a serious bug that will need to be fixed.

Great feedback Ralf. I'll look at this in coming days and get that function
to work well. Perhaps you can just touch up the stubs by hand for the moment
while I properly fix the problems.

Mike

-- 
Greedo shoots first? Not in my Star Wars.


More information about the jcifs mailing list