1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

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
(This used to be commit eb196070e6)
This commit is contained in:
Andrew Tridgell
2002-02-18 11:07:57 +00:00
parent 1736b99a50
commit c2729d59a6
2 changed files with 40 additions and 1 deletions

View File

@ -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);
}