2009-12-18 22:36:41 +00:00
|
|
|
diff -up nss-3.12.5/mozilla/security/nss/lib/sysinit/nsssysinit.c.546221 nss-3.12.5/mozilla/security/nss/lib/sysinit/nsssysinit.c
|
2009-12-20 06:36:21 +00:00
|
|
|
--- nss-3.12.5/mozilla/security/nss/lib/sysinit/nsssysinit.c.546221 2009-12-19 21:11:06.590930221 -0800
|
|
|
|
+++ nss-3.12.5/mozilla/security/nss/lib/sysinit/nsssysinit.c 2009-12-19 21:17:29.019931181 -0800
|
|
|
|
@@ -37,8 +37,6 @@
|
|
|
|
#include "prio.h"
|
|
|
|
#include "prprf.h"
|
2009-12-18 22:36:41 +00:00
|
|
|
|
2009-12-20 06:36:21 +00:00
|
|
|
-
|
|
|
|
-
|
|
|
|
/*
|
|
|
|
* The following provides a default example for operating systems to set up
|
|
|
|
* and manage applications loading NSS on their OS globally.
|
|
|
|
@@ -208,8 +206,8 @@ askpw=any timeout=30 ] } ";
|
2009-12-18 22:36:41 +00:00
|
|
|
static char **
|
|
|
|
get_list(char *filename, char *stripped_parameters)
|
|
|
|
{
|
|
|
|
- char **module_list = PORT_ZNewArray(char *, 4);
|
|
|
|
- char *userdb;
|
|
|
|
+ char **module_list = PORT_ZNewArray(char *, 5);
|
|
|
|
+ char *userdb, *sysdb;
|
|
|
|
int isFIPS = getFIPSMode();
|
|
|
|
const char *nssflags = isFIPS ? nssDefaultFIPSFlags : nssDefaultFlags;
|
|
|
|
int next = 0;
|
2009-12-20 06:36:21 +00:00
|
|
|
@@ -219,13 +217,20 @@ get_list(char *filename, char *stripped_
|
2009-12-18 22:36:41 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
- userdb = getUserDB();
|
2009-12-26 17:30:23 +00:00
|
|
|
+ sysdb = getSystemDB();
|
2009-12-18 22:36:41 +00:00
|
|
|
+ userdb = getUserDB();
|
|
|
|
+
|
|
|
|
+ if (sysdb && !strcmp(filename, sysdb))
|
|
|
|
+ filename = NULL;
|
|
|
|
+ if (userdb && !strcmp(filename, userdb))
|
|
|
|
+ filename = NULL;
|
|
|
|
+
|
|
|
|
if (userdb != NULL) {
|
|
|
|
/* return a list of databases to open. First the user Database */
|
|
|
|
module_list[next++] = PR_smprintf(
|
|
|
|
"library= "
|
|
|
|
"module=\"NSS User database\" "
|
|
|
|
- "parameters=\"configdir='sql:%s' %s\" "
|
|
|
|
+ "parameters=\"configdir='sql:%s' %s tokenDescription='NSS user database'\" "
|
|
|
|
"NSS=\"%sflags=internal%s\"",
|
|
|
|
userdb, stripped_parameters, nssflags,
|
|
|
|
isFIPS ? ",FIPS" : "");
|
2009-12-20 06:36:21 +00:00
|
|
|
@@ -238,19 +243,32 @@ get_list(char *filename, char *stripped_
|
2009-12-18 22:36:41 +00:00
|
|
|
"parameters=\"configdir='sql:%s' %s\" "
|
|
|
|
"NSS=\"flags=internal,moduleDBOnly,defaultModDB,skipFirst\"",
|
|
|
|
userdb, stripped_parameters);
|
2009-12-20 06:36:21 +00:00
|
|
|
- }
|
|
|
|
+ }
|
|
|
|
+
|
2009-12-18 22:36:41 +00:00
|
|
|
+ if (filename && 0 /* This doesn't actually work. If we register
|
|
|
|
+ both this and the sysdb (in either order)
|
|
|
|
+ then only one of them actually shows up */) {
|
|
|
|
+ module_list[next++] = PR_smprintf(
|
|
|
|
+ "library= "
|
|
|
|
+ "module=\"NSS database\" "
|
|
|
|
+ "parameters=\"configdir='sql:%s' tokenDescription='NSS database sql:%s'\" "
|
|
|
|
+ "NSS=\"%sflags=internal\"",filename, filename, nssflags);
|
|
|
|
+ }
|
2009-12-20 06:36:21 +00:00
|
|
|
|
2009-12-18 22:36:41 +00:00
|
|
|
/* now the system database (always read only) */
|
|
|
|
- module_list[next++] = PR_smprintf(
|
|
|
|
- "library= "
|
|
|
|
- "module=\"NSS system database\" "
|
|
|
|
- "parameters=\"configdir='sql:%s' tokenDescription='NSS system database' flags=readonly\" "
|
|
|
|
- "NSS=\"%sflags=internal,critical\"",filename, nssDefaultFlags);
|
|
|
|
+ if (sysdb) {
|
|
|
|
+ module_list[next++] = PR_smprintf(
|
|
|
|
+ "library= "
|
|
|
|
+ "module=\"NSS system database\" "
|
|
|
|
+ "parameters=\"configdir='sql:%s' tokenDescription='NSS system database' flags=readonly\" "
|
|
|
|
+ "NSS=\"%sflags=internal,critical\"",sysdb, nssflags);
|
|
|
|
+ }
|
|
|
|
|
|
|
|
/* that was the last module */
|
|
|
|
module_list[next] = 0;
|
|
|
|
|
|
|
|
PORT_Free(userdb);
|
|
|
|
+ PORT_Free(sysdb);
|
|
|
|
|
|
|
|
return module_list;
|
|
|
|
}
|