]> git.sur5r.net Git - openldap/commitdiff
ITS#8484 - Fix MozNSS initialization
authorSoohoon Lee <soohoon.lee@f5.com>
Wed, 24 Aug 2016 02:07:42 +0000 (19:07 -0700)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 9 Feb 2018 17:37:02 +0000 (17:37 +0000)
libraries/libldap/tls_m.c

index 1ce15dabeecf86ab145315f9a5108d645bdab58e..7fff5b43c22b13b36714d89612f7749bdef1d021 100644 (file)
@@ -1142,6 +1142,8 @@ tlsm_auth_cert_handler(void *arg, PRFileDesc *fd,
        return ret;
 }
 
+static PRCallOnceType tlsm_register_shutdown_callonce = {0,0};
+
 static SECStatus
 tlsm_nss_shutdown_cb( void *appData, void *nssData )
 {
@@ -1154,10 +1156,15 @@ tlsm_nss_shutdown_cb( void *appData, void *nssData )
                SECMOD_DestroyModule( pem_module );
                pem_module = NULL;
        }
+
+       /* init callonce so it can be armed again for cases like persistent daemon with LDAP_OPT_X_TLS_NEWCTX */
+       tlsm_register_shutdown_callonce.initialized = 0;
+       tlsm_register_shutdown_callonce.inProgress = 0;
+       tlsm_register_shutdown_callonce.status = 0;
+
        return rc;
 }
 
-static PRCallOnceType tlsm_register_shutdown_callonce = {0,0};
 static PRStatus PR_CALLBACK
 tlsm_register_nss_shutdown_cb( void )
 {