Fix busted loading of module for WIN32 and delete the TextGenContext used to fetch the name of the module for the root certificates.

This commit is contained in:
javi%netscape.com 2000-11-29 20:00:21 +00:00
Родитель 85666e8d28
Коммит a2bb31a18e
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -1015,6 +1015,7 @@ SSM_InitNSS(char* certpath, SSMControlConnection *ctrl, PRInt32 policy)
PK11SlotListElement *listElement;
SSMTextGenContext *cx = NULL;
char *modName=NULL, *processDir = NULL, *fullModuleName=NULL;
int modType;
SSMStatus srv;
PR_EnterMonitor(policySetLock);
@ -1087,6 +1088,7 @@ SSM_InitNSS(char* certpath, SSMControlConnection *ctrl, PRInt32 policy)
goto loser;
}
srv = SSM_FindUTF8StringInBundles(cx, "root_certificates", &modName);
SSMTextGen_DestroyContext(cx);
if (srv != SSM_SUCCESS) {
SSM_DEBUG("Couldn't get the value for \"root_certificates\" "
"from properties file\n");
@ -1100,7 +1102,11 @@ SSM_InitNSS(char* certpath, SSMControlConnection *ctrl, PRInt32 policy)
SSM_DEBUG("I think the process lives in <%s>\n", processDir);
fullModuleName = PR_smprintf("%s%s", processDir, LOADABLE_CERTS_MODULE);
fullModuleName = SSM_ConvertMacPathToUnix(fullModuleName);
#elif defined(WIN32)
fullModuleName = PL_strdup(LOADABLE_CERTS_MODULE);
#endif
/* If a module exists with the same name, delete it. */
SECMOD_DeleteModule(modName, &modType);
SSM_DEBUG("Will try to load <%s> for root certs.\n");
if (SECMOD_AddNewModule(modName, fullModuleName, 0, 0) != SECSuccess) {
SSM_DEBUG("Couldn't load the module at <%s>",fullModuleName);