diff options
author | relyea%netscape.com <devnull@localhost> | 2002-01-29 22:27:15 +0000 |
---|---|---|
committer | relyea%netscape.com <devnull@localhost> | 2002-01-29 22:27:15 +0000 |
commit | 471f6dc41c8df05c39c3f5ad4f1b7ed573c752dd (patch) | |
tree | b98574c8ef91f4e55000d707fcbf28f7be5e7fa2 | |
parent | 7d4803200198aa81672f565ec4e4b785c215ed9d (diff) | |
download | nss-hg-471f6dc41c8df05c39c3f5ad4f1b7ed573c752dd.tar.gz |
Restore idempontency to nss_init*
-rw-r--r-- | security/nss/lib/nss/nssinit.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/security/nss/lib/nss/nssinit.c b/security/nss/lib/nss/nssinit.c index 24b021d65..d6ce45ee8 100644 --- a/security/nss/lib/nss/nssinit.c +++ b/security/nss/lib/nss/nssinit.c @@ -315,6 +315,8 @@ nss_FindExternalRoot(const char *dbpath) * be opened. */ +static PRBool nss_IsInitted = PR_FALSE; + static SECStatus nss_Init(const char *configdir, const char *certPrefix, const char *keyPrefix, const char *secmodName, PRBool readOnly, PRBool noCertDB, @@ -328,6 +330,10 @@ nss_Init(const char *configdir, const char *certPrefix, const char *keyPrefix, char *lkeyPrefix = NULL; char *lsecmodName = NULL; + if (nss_IsInitted) { + return SECSuccess; + } + flags = nss_makeFlags(readOnly,noCertDB,noModDB,forceOpen, pk11_password_required); if (flags == NULL) return rv; @@ -387,6 +393,7 @@ loser: } } #endif + nss_IsInitted = PR_TRUE; } return rv; } @@ -452,6 +459,7 @@ NSS_Shutdown(void) SECOID_Shutdown(); SECMOD_Shutdown(); STAN_Shutdown(); + nss_IsInitted = PR_FALSE; } |