REPOST: sesssetup.c, encrypted passwords and unicode

Richard Sharpe rsharpe at
Wed Apr 30 18:04:28 GMT 2003

On Wed, 30 Apr 2003, Nir Soffer wrote:

> Hi again! :)
> Long story short - unicode plaintext passwords don't work (not in latest 
> CVS either). Tracked down to a small piece of code in sesssetup.c 
> (detailed below) which snarfs the wrong passlen from the incoming packet 
> and as a result thinks the password is NULL.
> I fixed it in my local copy, and windows2k works with it just fine, 
> however, this unsurprisingly breaks Windows'98 rather unforgivably.
> I was wondering how in the context of sesssetup.c in 
> reply_sesssetup_and_X I can figure out if the connection has unicode 
> strings or not, as I need to know this to switch between passlen1 and 
> passlen2. I couldn't find anything in the connection structure...

Hmmm, the flags or flags2 field of the SMB header contains a bit stating 
whether or not UNICODE is in use. Can't you use that?

Richard Sharpe, rsharpe[at], rsharpe[at], 

More information about the samba-technical mailing list