(merge from 3.0)
commitf3ecdea56d9ea6d562ace84f0e653a641eb96f6e
authorAndrew Bartlett <abartlet@samba.org>
Wed, 25 Feb 2004 22:09:46 +0000 (25 22:09 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 25 Feb 2004 22:09:46 +0000 (25 22:09 +0000)
tree7436822b53a9d95c577c175c959b5929cb3b2772
parente46aaffe97919afb1c92f56376f9578825012b92
(merge from 3.0)

I *hate* global variables...

OK, what was happening here was that we would invalidate global_sam_sid
when we set the sid into secrets.tdb, to force a re-read.

The problem was, we would do *two* writes into the TDB, and the second one
(in the PDC/BDC case) would be of a NULL pointer.  This caused smbd startups
to fail, on a blank TDB.

By using a local variable in the pdb_generate_sam_sid() code, we avoid this
particular trap.

I've also added better debugging for the case where this all matters, which
is particularly for LDAP, where it finds out a domain SID from the sambaDomain
object.

Andrew Bartlett
source/passdb/machine_sid.c
source/passdb/pdb_ldap.c
source/utils/net.c
source/utils/smbpasswd.c