diff options
author | Andrew Tridgell <tridge@samba.org> | 2002-02-18 11:07:57 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2002-02-18 11:07:57 +0000 |
commit | eb196070e62b45b113e5712f27198c50c5c95657 (patch) | |
tree | 962074ed93d8a4178584cabe9633cc333cf4bbc0 /source/lib/messages.c | |
parent | 569505b77140c2688aeab4df058b864464f23c1d (diff) | |
download | samba-eb196070e62b45b113e5712f27198c50c5c95657.tar.gz samba-eb196070e62b45b113e5712f27198c50c5c95657.tar.xz samba-eb196070e62b45b113e5712f27198c50c5c95657.zip |
serialise all domain auth requests
this is needed because W2K will send a TCP reset to any open
connections that have not done a negprot when a second connection is
made. This meant that under heavy netlogon load a Samba domain member
would fail authentications.
Jeremy, you may wish to port this to 2.2.x
Diffstat (limited to 'source/lib/messages.c')
-rw-r--r-- | source/lib/messages.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/lib/messages.c b/source/lib/messages.c index 096452784a3..7ce050d70d6 100644 --- a/source/lib/messages.c +++ b/source/lib/messages.c @@ -458,3 +458,33 @@ BOOL message_send_all(TDB_CONTEXT *conn_tdb, int msg_type, } /** @} **/ + + +/* + lock the messaging tdb based on a string - this is used as a primitive form of mutex + between smbd instances. +*/ +BOOL message_named_mutex(const char *name) +{ + TDB_DATA key; + + if (!message_init()) return False; + + key.dptr = name; + key.dsize = strlen(name)+1; + + return (tdb_chainlock(tdb, key) == 0); +} + +/* + unlock a named mutex +*/ +void message_named_mutex_release(const char *name) +{ + TDB_DATA key; + + key.dptr = name; + key.dsize = strlen(name)+1; + + tdb_chainunlock(tdb, key); +} |