summaryrefslogtreecommitdiffstats
path: root/nss_pcache.c
diff options
context:
space:
mode:
authorrcritten <>2005-11-18 16:10:23 +0000
committerrcritten <>2005-11-18 16:10:23 +0000
commitd4cb1bb2095b03b502e2fd70f3c05d87ea01f9a2 (patch)
treea13ea993cc64a0c504a7cf6e57055a228aede099 /nss_pcache.c
parent1a9c5d367730b60dcff8cd9b0adc8c6ea0e88feb (diff)
downloadmod_nss-d4cb1bb2095b03b502e2fd70f3c05d87ea01f9a2.tar.gz
mod_nss-d4cb1bb2095b03b502e2fd70f3c05d87ea01f9a2.tar.xz
mod_nss-d4cb1bb2095b03b502e2fd70f3c05d87ea01f9a2.zip
Fix command-line argument miscounting caused by the addition of the
FIPS flag. The result was that the database prefix was always missed. Also check the return value of NSS_Initialize() and print and exit if the database is not opened.
Diffstat (limited to 'nss_pcache.c')
-rw-r--r--nss_pcache.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/nss_pcache.c b/nss_pcache.c
index e1c51b1..65a7a02 100644
--- a/nss_pcache.c
+++ b/nss_pcache.c
@@ -319,7 +319,12 @@ int main(int argc, char ** argv)
PK11_ConfigurePKCS11(NULL,NULL,NULL, INTERNAL_TOKEN_NAME, NULL, NULL,NULL,NULL,8,1);
/* Initialize NSS and open the certificate database read-only. */
- rv = NSS_Initialize(argv[2], argc == 3 ? argv[3] : NULL, argc == 3 ? argv[3] : NULL, "secmod.db", NSS_INIT_READONLY);
+ rv = NSS_Initialize(argv[2], argc == 4 ? argv[3] : NULL, argc == 4 ? argv[3] : NULL, "secmod.db", NSS_INIT_READONLY);
+
+ if (rv != SECSuccess) {
+ fprintf(stderr, "Unable to initialize NSS database: %d\n", rv);
+ exit(1);
+ }
if (fipsmode) {
if (!PK11_IsFIPS()) {