summaryrefslogtreecommitdiff
path: root/source3/utils/smbpasswd.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-02-25 22:01:02 +0000
committerAndrew Bartlett <abartlet@samba.org>2004-02-25 22:01:02 +0000
commit56bd63b1cde5e1bde8f88b0c6a06f1131f1dac13 (patch)
treef0444780796a3d0a362a94772a4252b2b891f519 /source3/utils/smbpasswd.c
parentfd6b9c02b91ea39e8c7575e1f5f106509940ba1f (diff)
downloadsamba-56bd63b1cde5e1bde8f88b0c6a06f1131f1dac13.tar.gz
samba-56bd63b1cde5e1bde8f88b0c6a06f1131f1dac13.tar.bz2
samba-56bd63b1cde5e1bde8f88b0c6a06f1131f1dac13.zip
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 (This used to be commit 86ad04d26d3065a99b08afaaf2914968a9e701c5)
Diffstat (limited to 'source3/utils/smbpasswd.c')
-rw-r--r--source3/utils/smbpasswd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index 2f68d02ef6..0476a2e39c 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -349,6 +349,12 @@ static int process_root(int local_flags)
goto done;
}
+ /* Ensure passdb startup(). */
+ if(!initialize_password_db(False)) {
+ DEBUG(0, ("Failed to open passdb!\n"));
+ exit(1);
+ }
+
/* Ensure we have a SAM sid. */
get_global_sam_sid();