Fix for bug 232604. don't open DBs in user's directory in shlibsign. r=nelson

This commit is contained in:
julien.pierre.bugs%sun.com 2005-11-15 00:34:39 +00:00
Родитель 95bc5eaa3c
Коммит 59d85a9b9a
1 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -37,7 +37,7 @@
/* /*
* Test program for SDR (Secret Decoder Ring) functions. * Test program for SDR (Secret Decoder Ring) functions.
* *
* $Id: shlibsign.c,v 1.13 2004/04/25 15:02:53 gerv%gerv.net Exp $ * $Id: shlibsign.c,v 1.14 2005/11/15 00:34:39 julien.pierre.bugs%sun.com Exp $
*/ */
#ifdef XP_UNIX #ifdef XP_UNIX
@ -155,6 +155,7 @@ main (int argc, char **argv)
int keySize = 1024; int keySize = 1024;
PQGParams *pqgParams = NULL; PQGParams *pqgParams = NULL;
PQGVerify *pqgVerify = NULL; PQGVerify *pqgVerify = NULL;
char* nssDir = NULL;
#ifdef USES_LINKS #ifdef USES_LINKS
int ret; int ret;
struct stat stat_buf; struct stat stat_buf;
@ -187,7 +188,7 @@ main (int argc, char **argv)
#endif #endif
case 'd': case 'd':
SECU_ConfigDirectory(optstate->value); nssDir = optstate->value;
break; break;
case 'i': case 'i':
@ -214,10 +215,15 @@ main (int argc, char **argv)
*/ */
PK11_SetPasswordFunc(SECU_GetModulePassword); PK11_SetPasswordFunc(SECU_GetModulePassword);
rv = NSS_Init(SECU_ConfigDirectory(NULL)); if (nssDir) {
rv = NSS_Init(nssDir);
if (rv != SECSuccess) { if (rv != SECSuccess) {
rv = NSS_NoDB_Init(""); rv = NSS_NoDB_Init("");
} }
} else {
rv = NSS_NoDB_Init("");
}
if (rv != SECSuccess) { if (rv != SECSuccess) {
lperror("NSS_Init failed"); lperror("NSS_Init failed");
goto prdone; goto prdone;