Bug 495384: Initialize NSS by calling NSS_Initialize with

NSS_INIT_NOROOTINIT to turn off the loading of the root certs
module in nss_Init.  We load the root certs module in the
InstallLoadableRoots function, so we don't need nss_Init to load
it.  r=rrelyea,kaie.
This commit is contained in:
Wan-Teh Chang 2009-08-29 10:04:30 -07:00
parent 2aa0b4e4e8
commit 974aa31625

View File

@ -1605,7 +1605,14 @@ nsNSSComponent::InitializeNSS(PRBool showWarningBox)
ConfigureInternalPKCS11Token();
SECStatus init_rv = ::NSS_InitReadWrite(profileStr.get());
// The NSS_INIT_NOROOTINIT flag turns off the loading of the root certs
// module by NSS_Initialize because we will load it in InstallLoadableRoots
// later. It also allows us to work around a bug in the system NSS in
// Ubuntu 8.04, which loads any nonexistent "<configdir>/libnssckbi.so" as
// "/usr/lib/nss/libnssckbi.so".
PRUint32 init_flags = NSS_INIT_NOROOTINIT | NSS_INIT_OPTIMIZESPACE;
SECStatus init_rv = ::NSS_Initialize(profileStr.get(), "", "",
SECMOD_DB, init_flags);
if (init_rv != SECSuccess) {
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init NSS r/w in %s\n", profileStr.get()));
@ -1618,7 +1625,9 @@ nsNSSComponent::InitializeNSS(PRBool showWarningBox)
}
// try to init r/o
init_rv = NSS_Init(profileStr.get());
init_flags |= NSS_INIT_READONLY;
init_rv = ::NSS_Initialize(profileStr.get(), "", "",
SECMOD_DB, init_flags);
if (init_rv != SECSuccess) {
PR_LOG(gPIPNSSLog, PR_LOG_DEBUG, ("can not init in r/o either\n"));