From 8a68f96f8cea2c53c8babf2ec826dfc6ef1cc199 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 22 Jun 2005 02:12:26 +0000 Subject: r7827: Add in-memory keytab to Samba4, using the new MEMORY_WILDCARD keytab support in Heimdal. This removes the 'ext_keytab' step from my Samba4/WinXP client howto. In doing this work, I realised that the replay cache in Heimdal is currently a no-op, so I have removed the calls to it, and therefore the mutex calls from passdb/secrets.c. This patch also includes a replacement 'magic' mechanism detection, that does not issue extra error messages from deep inside the GSSAPI code. Andrew Bartlett (This used to be commit c19d5706f4fa760415b727b970bc99e7f1abd064) --- source4/passdb/secrets.c | 51 ------------------------------------------------ 1 file changed, 51 deletions(-) (limited to 'source4/passdb') diff --git a/source4/passdb/secrets.c b/source4/passdb/secrets.c index 81e92b4da0..44f9fe9311 100644 --- a/source4/passdb/secrets.c +++ b/source4/passdb/secrets.c @@ -123,57 +123,6 @@ char *secrets_fetch_machine_password(const char *domain) } - -/******************************************************************************* - Lock the secrets tdb based on a string - this is used as a primitive form of mutex - between smbd instances. -*******************************************************************************/ - -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); - if (ret == 0) - DEBUG(10,("secrets_named_mutex: got mutex for %s\n", name )); - } - - if (ret == 0) { - *p_ref_count = ++ref_count; - DEBUG(10,("secrets_named_mutex: ref_count for mutex %s = %u\n", name, (uint_t)ref_count )); - } - return (ret == 0); -} - -/******************************************************************************* - Unlock a named mutex. -*******************************************************************************/ - -void secrets_named_mutex_release(const char *name, size_t *p_ref_count) -{ - size_t ref_count = *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 )); - } - - *p_ref_count = --ref_count; - DEBUG(10,("secrets_named_mutex_release: ref_count for mutex %s = %u\n", name, (uint_t)ref_count )); -} - /* connect to the schannel ldb */ -- cgit