[Fedora-directory-commits] mod_nss nss_pcache.c,1.7,1.8

Robert Crittenden (rcritten) fedora-directory-commits at redhat.com
Fri Nov 18 16:10:38 UTC 2005


Author: rcritten

Update of /cvs/dirsec/mod_nss
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26699

Modified Files:
	nss_pcache.c 
Log Message:
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.



Index: nss_pcache.c
===================================================================
RCS file: /cvs/dirsec/mod_nss/nss_pcache.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- nss_pcache.c	19 Aug 2005 21:42:20 -0000	1.7
+++ nss_pcache.c	18 Nov 2005 16:10:23 -0000	1.8
@@ -319,7 +319,12 @@
     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()) {




More information about the Fedora-directory-commits mailing list