]> 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, 8 Dec 2017 15:00:02 +0000 (07:00 -0800)
libraries/libldap/tls_m.c

index 7e48b8a671c727eddd120feaa74c54bb3b8018cd..f13dd2b18b824ff297f5c1954bfcaf1eadab2177 100644 (file)
@@ -1144,6 +1144,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 )
 {
@@ -1156,10 +1158,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 )
 {