TNG works with Win2k, fails with Win98

Patrick J. LoPresti patl at cag.lcs.mit.edu
Mon Feb 21 21:07:52 GMT 2000


Richard Sharpe <sharpe at ns.aus.com> writes:

> >When I fixed this, my logon scripts started working again.
> >
> >My patch is appended; rewrite it as you see fit...
> 
> Hmmm, that is interesting, because logon scripts worked for me in an all
> Samba-TNG after I fixed the auth problem ...

Slightly different copies of the CVS tree, perhaps?  Or different
authentication mechanisms?  (I am using smbpasswd.)

My changes are pretty simple, and I swear they *do* fix my problem.
Before my patch, I was seeing empty strings for the logon script, the
home share, and so forth.

Digging a little deeper, the function pwdb_smb_to_sam() in sampassdb.c
uses a bunch of unititialized local static variables (home_dir,
home_drive, logon_script, etc.)  These locals are arrays of char,
which is where my empty strings were coming from; see the call to
pwdb_smb_to_sam() in getsamfile21pwent().

(I just double-checked all this with a freshly-checked-out copy of
TNG.)

What's up with those unitialized static char arrays?  They are
guaranteed to be zero, but there are better ways to get the various
pw_buf fields set to empty strings if that is the goal...

 - Pat


More information about the samba-ntdom mailing list