summaryrefslogtreecommitdiff
path: root/source3/lib/server_mutex.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-01-16 20:08:33 +0000
committerJeremy Allison <jra@samba.org>2003-01-16 20:08:33 +0000
commiteffbd70c21d49255e9cf5eae3e71a7fe93fc7950 (patch)
tree9bdc2ae7d405be443b21f3e8e40382aa9179e163 /source3/lib/server_mutex.c
parent815dcc082ab76ba9d63baf497f59d6cbb2915357 (diff)
downloadsamba-effbd70c21d49255e9cf5eae3e71a7fe93fc7950.tar.gz
samba-effbd70c21d49255e9cf5eae3e71a7fe93fc7950.tar.bz2
samba-effbd70c21d49255e9cf5eae3e71a7fe93fc7950.zip
Fixed up mutex protection around winbindd logon code. Sync with APP-HEAD.
Jeremy. (This used to be commit 3d04872499332ef2d8e7479b924afc8fc1ac29d7)
Diffstat (limited to 'source3/lib/server_mutex.c')
-rw-r--r--source3/lib/server_mutex.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/server_mutex.c b/source3/lib/server_mutex.c
index 3e5512c734..878e5497d8 100644
--- a/source3/lib/server_mutex.c
+++ b/source3/lib/server_mutex.c
@@ -30,6 +30,8 @@
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)
{
@@ -38,7 +40,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)) {
+ if (!secrets_named_mutex(mutex_server_name, 10, &ref_count)) {
DEBUG(10,("grab_server_mutex: failed for %s\n", name));
SAFE_FREE(mutex_server_name);
return False;
@@ -50,7 +52,7 @@ BOOL grab_server_mutex(const char *name)
void release_server_mutex(void)
{
if (mutex_server_name) {
- secrets_named_mutex_release(mutex_server_name);
+ secrets_named_mutex_release(mutex_server_name, &ref_count);
SAFE_FREE(mutex_server_name);
}
}