diff options
Diffstat (limited to 'source4/passdb')
-rw-r--r-- | source4/passdb/secrets.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/passdb/secrets.c b/source4/passdb/secrets.c index d13e61223db..74f174efe6c 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 )); |