diff options
author | Robert Relyea <rrelyea@redhat.com> | 2016-12-13 16:13:26 +0100 |
---|---|---|
committer | Robert Relyea <rrelyea@redhat.com> | 2016-12-13 16:13:26 +0100 |
commit | cc2e43202159c30df0cd11a4a5b1bf2457e23a85 (patch) | |
tree | 0a9adfd6a7123b2244868c36ebefb942e7c06da9 | |
parent | 5493913df772fdfb70343b175da5dbad3aca6713 (diff) | |
download | nss-hg-cc2e43202159c30df0cd11a4a5b1bf2457e23a85.tar.gz |
Bug 1318633, Support initial init with noCertDB, later without noCertDB, r=martin.thomson
-rw-r--r-- | lib/pk11wrap/pk11pars.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/pk11wrap/pk11pars.c b/lib/pk11wrap/pk11pars.c index cbba8b443..ee20789cc 100644 --- a/lib/pk11wrap/pk11pars.c +++ b/lib/pk11wrap/pk11pars.c @@ -1014,6 +1014,10 @@ secmod_getConfigDir(const char *spec, char **certPrefix, char **keyPrefix, *certPrefix = NULL; *keyPrefix = NULL; *readOnly = NSSUTIL_ArgHasFlag("flags", "readOnly", spec); + if (NSSUTIL_ArgHasFlag("flags", "nocertdb", spec) || + NSSUTIL_ArgHasFlag("flags", "nokeydb", spec)) { + return NULL; + } spec = NSSUTIL_ArgStrip(spec); while (*spec) { @@ -1133,6 +1137,13 @@ secmod_matchConfig(char *configDir1, char *configDir2, char *keyPrefix1, char *keyPrefix2, PRBool isReadOnly1, PRBool isReadOnly2) { + /* TODO: Document the answer to the question: + * "Why not allow them to match if they are both NULL?" + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=1318633#c1 + */ + if ((configDir1 == NULL) || (configDir2 == NULL)) { + return PR_FALSE; + } if (strcmp(configDir1, configDir2) != 0) { return PR_FALSE; } @@ -1169,7 +1180,6 @@ secmod_MatchConfigList(const char *spec, SECMODConfigList *conflist, int count) config = secmod_getConfigDir(spec, &certPrefix, &keyPrefix, &isReadOnly); if (!config) { - ret = PR_TRUE; goto done; } |