summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-03-17 23:06:12 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-03-17 23:06:12 +0000
commita8eaea53ed70ef998a510b6dcf0288462207f9a0 (patch)
tree4f9b1b363b9e181682de601313271d9745ee7548 /source3/lib
parente88eab35bc03a2d108b27f2209ec4cfb395dcdba (diff)
downloadsamba-a8eaea53ed70ef998a510b6dcf0288462207f9a0.tar.gz
samba-a8eaea53ed70ef998a510b6dcf0288462207f9a0.tar.bz2
samba-a8eaea53ed70ef998a510b6dcf0288462207f9a0.zip
Merge from HEAD - make winbindd locking sane again:
Original message: This patch attemptes to clean up winbindd's mutex locking. The current locking scheme in winbind is a complete mess - indeed, the next step should be to push the locking into cli_full_connection(), but I'll leave it for now. This patch works on the noted behaviour that 2 parts of the connection process need protection - and independent protection. Tim Potter did some work on this a little while back, verifying the second case. The two cases are: - between connect() and first session setup - during the auth2 phase of the netlogon pipe setup. I've removed the counter on the lock, as I fail to see what it gains us. This patch also adds 'anonymous fallback' to our winbindd -> DC connection. If the authenticated connection fails (wbinfo -A specifed) - say that account isn't trusted by a trusted DC - then we try an anonymous. Both tpot and mbp like the patch. Andrew Bartlett (This used to be commit b5283c00a900393b83f0edb2785c5caf402404eb)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/server_mutex.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/lib/server_mutex.c b/source3/lib/server_mutex.c
index 878e5497d8..3e5512c734 100644
--- a/source3/lib/server_mutex.c
+++ b/source3/lib/server_mutex.c
@@ -30,8 +30,6 @@
like the single-connection that NT makes. */
static char *mutex_server_name;
-/* FIXME. ref_count should be allocated per name... JRA. */
-size_t ref_count;
BOOL grab_server_mutex(const char *name)
{
@@ -40,7 +38,7 @@ BOOL grab_server_mutex(const char *name)
DEBUG(0,("grab_server_mutex: malloc failed for %s\n", name));
return False;
}
- if (!secrets_named_mutex(mutex_server_name, 10, &ref_count)) {
+ if (!secrets_named_mutex(mutex_server_name, 10)) {
DEBUG(10,("grab_server_mutex: failed for %s\n", name));
SAFE_FREE(mutex_server_name);
return False;
@@ -52,7 +50,7 @@ BOOL grab_server_mutex(const char *name)
void release_server_mutex(void)
{
if (mutex_server_name) {
- secrets_named_mutex_release(mutex_server_name, &ref_count);
+ secrets_named_mutex_release(mutex_server_name);
SAFE_FREE(mutex_server_name);
}
}