]> git.sur5r.net Git - openldap/commit
ITS#7022 NSS_Init* functions are not thread safe
authorRich Megginson <rmeggins@redhat.com>
Tue, 16 Aug 2011 18:01:16 +0000 (12:01 -0600)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 28 Oct 2011 02:07:51 +0000 (19:07 -0700)
commit9e68ff52b703d32b1a6c517dd7fdff1386cb7e82
treee5a9bf5914c30a29510e1002aec05675346b2c81
parent09c5f495a6164391a00e02dc1c7106b264d9ea6e
ITS#7022 NSS_Init* functions are not thread safe

The NSS_InitContext et. al, and their corresponding shutdown functions,
are not thread safe.  There can only be one thread at a time calling
these functions.  Protect the calls with a mutex.  Create the mutex
using a PR_CallOnce to ensure that the mutex is only created once and
not used before created.  Move the registration of the nss shutdown
callback to also use a PR_CallOnce.  Removed the call to
SSL_ClearSessionCache() because it is always called at shutdown, and we must
not call it more than once.
libraries/libldap/tls_m.c