Author: jmagne
Update of /cvs/dirsec/esc/src/lib/coolkey
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv631
Modified Files:
Tag: PKI_8_0_RTM_BRANCH
NSSManager.h NSSManager.cpp
Log Message:
Bug 528057 - ESC Installer does not support shared terminals.
Index: NSSManager.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/NSSManager.h,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -r1.5 -r1.5.2.1
--- NSSManager.h 13 Jun 2009 23:44:52 -0000 1.5
+++ NSSManager.h 17 Nov 2009 23:38:43 -0000 1.5.2.1
@@ -15,6 +15,7 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+
#ifdef DARWIN
#define COOLKEY_PKCS11_LIBRARY "/Library/Application
Support/CoolKey/PKCS11/libcoolkeypk11.dylib"
#else
@@ -84,9 +85,7 @@
static unsigned int lastError;
-#ifdef LINUX
PK11SlotInfo *systemCertDB;
-#endif
SmartCardMonitoringThread *mpSCMonitoringThread;
};
Index: NSSManager.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/NSSManager.cpp,v
retrieving revision 1.6
retrieving revision 1.6.2.1
diff -u -r1.6 -r1.6.2.1
--- NSSManager.cpp 13 Jun 2009 23:44:52 -0000 1.6
+++ NSSManager.cpp 17 Nov 2009 23:38:43 -0000 1.6.2.1
@@ -53,9 +53,7 @@
PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s
NSSManager::NSSManager:\n",GetTStamp(tBuff,56)));
mpSCMonitoringThread = NULL;
NSSManager::lastError = NSS_NO_ERROR;
-#ifdef LINUX
systemCertDB = NULL;
-#endif
}
NSSManager::~NSSManager()
@@ -118,21 +116,44 @@
return E_FAIL;
}
-#ifdef LINUX
-
// Load our Linux only database
+ char modspec_alt[512];
+ // Load our alternate db, if provided.
- const char *modspec = "configdir='/etc/pki/nssdb'
tokenDescripton='SystemDB' flags='readOnly'";
- PK11SlotInfo *systemCertDB = SECMOD_OpenUserDB(modspec);
+ const char *alt_db = CoolKeyGetConfig("esc.global.alt.nss.db");
- if(!systemCertDB)
+#ifdef LINUX
+
+ if(!alt_db)
{
- PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("%s NSSManager::InitNSS problem
loading Linux System Cert Database!\n",GetTStamp(tBuff,56)));
+ alt_db = "/etc/pki/nssdb";
}
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("%s NSSManager alt_db %s
\n",GetTStamp(tBuff,56),alt_db));
#endif
+ if(alt_db)
+ {
+ if(strlen(alt_db) < 400 )
+ {
+ sprintf(modspec_alt, "configdir='%s'
tokenDescription='SystemDB' flags='readOnly'",alt_db);
+
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("%s NSSManager modspec_alt %s
\n",GetTStamp(tBuff,56),modspec_alt));
+ systemCertDB = SECMOD_OpenUserDB(modspec_alt);
+
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("%s NSSManager systemCertDB %p
\n",GetTStamp(tBuff,56),systemCertDB));
+
+ if(!systemCertDB)
+ {
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("%s NSSManager::InitNSS
problem loading Alternate Cert Database!\n",GetTStamp(tBuff,56)));
+
+ }
+
+ }
+
+ }
+
mpSCMonitoringThread = new SmartCardMonitoringThread(userModule);
if (!mpSCMonitoringThread) {
SECMOD_UnloadUserModule(userModule);
@@ -157,16 +178,11 @@
// Logout all tokens.
PK11_LogoutAll();
-#ifdef LINUX
if(systemCertDB)
{
- SECMOD_CloseUserDB(systemCertDB);
-
PK11_FreeSlot(systemCertDB);
systemCertDB = NULL;
}
-
-#endif
}
bool
Show replies by date