summaryrefslogtreecommitdiff
path: root/source4/passdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-10-29 08:32:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:01 -0500
commit98052096e3150c2b1a3d31fc6fcc1dbc0d7a3067 (patch)
tree96e6bec152965d2b2501d14935933fad6cd67a37 /source4/passdb
parent659332794871c64470fd23b5a15e1f45fcb78a84 (diff)
downloadsamba-98052096e3150c2b1a3d31fc6fcc1dbc0d7a3067.tar.gz
samba-98052096e3150c2b1a3d31fc6fcc1dbc0d7a3067.tar.bz2
samba-98052096e3150c2b1a3d31fc6fcc1dbc0d7a3067.zip
r3359: Add magic auto-initialisation hooks here, to match the rest of
secrets. (Which will, I am assured, go away). Andrew Bartlett (This used to be commit 415ba959271f6f97d6fe3b923e49a58611edf8bd)
Diffstat (limited to 'source4/passdb')
-rw-r--r--source4/passdb/secrets.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/passdb/secrets.c b/source4/passdb/secrets.c
index d13e61223d..74f174efe6 100644
--- a/source4/passdb/secrets.c
+++ b/source4/passdb/secrets.c
@@ -129,6 +129,10 @@ BOOL secrets_named_mutex(const char *name, uint_t timeout, size_t *p_ref_count)
size_t ref_count = *p_ref_count;
int ret = 0;
+ secrets_init();
+ if (!tdb)
+ return False;
+
if (ref_count == 0) {
ret = tdb_lock_bystring(tdb->tdb, name, timeout);
if (ret == 0)
@@ -152,6 +156,10 @@ void secrets_named_mutex_release(const char *name, size_t *p_ref_count)
SMB_ASSERT(ref_count != 0);
+ secrets_init();
+ if (!tdb)
+ return;
+
if (ref_count == 1) {
tdb_unlock_bystring(tdb->tdb, name);
DEBUG(10,("secrets_named_mutex: released mutex for %s\n", name ));