From 98052096e3150c2b1a3d31fc6fcc1dbc0d7a3067 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Oct 2004 08:32:59 +0000 Subject: 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) --- source4/passdb/secrets.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4/passdb') 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 )); -- cgit