mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Turn on reset functionality for multiaccessdb clients.
This commit is contained in:
parent
5bbe7d36d7
commit
1b5946f3a0
@ -32,7 +32,7 @@
|
|||||||
*
|
*
|
||||||
* Private Key Database code
|
* Private Key Database code
|
||||||
*
|
*
|
||||||
* $Id: keydb.c,v 1.24 2002/06/25 23:00:57 relyea%netscape.com Exp $
|
* $Id: keydb.c,v 1.25 2002/08/02 21:41:00 relyea%netscape.com Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lowkeyi.h"
|
#include "lowkeyi.h"
|
||||||
@ -955,7 +955,9 @@ nsslowkey_OpenKeyDB(PRBool readOnly, const char *appName, const char *prefix,
|
|||||||
goto loser;
|
goto loser;
|
||||||
}
|
}
|
||||||
|
|
||||||
handle->dbname = PORT_Strdup(dbname);
|
handle->appname = appName ? PORT_Strdup(appName) : NULL ;
|
||||||
|
handle->dbname = appName ? PORT_Strdup(dbname) :
|
||||||
|
(prefix ? PORT_Strdup(prefix) : NULL);
|
||||||
handle->readOnly = readOnly;
|
handle->readOnly = readOnly;
|
||||||
|
|
||||||
if (appName) {
|
if (appName) {
|
||||||
@ -1022,6 +1024,7 @@ nsslowkey_CloseKeyDB(NSSLOWKEYDBHandle *handle)
|
|||||||
(* handle->db->close)(handle->db);
|
(* handle->db->close)(handle->db);
|
||||||
}
|
}
|
||||||
if (handle->dbname) PORT_Free(handle->dbname);
|
if (handle->dbname) PORT_Free(handle->dbname);
|
||||||
|
if (handle->appname) PORT_Free(handle->appname);
|
||||||
if (handle->global_salt) {
|
if (handle->global_salt) {
|
||||||
SECITEM_FreeItem(handle->global_salt,PR_TRUE);
|
SECITEM_FreeItem(handle->global_salt,PR_TRUE);
|
||||||
}
|
}
|
||||||
@ -2419,13 +2422,16 @@ nsslowkey_ResetKeyDB(NSSLOWKEYDBHandle *handle)
|
|||||||
return SECFailure;
|
return SECFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
PORT_Assert(handle->dbname != NULL);
|
if (handle->appname == NULL && handle->dbname == NULL) {
|
||||||
if (handle->dbname == NULL) {
|
|
||||||
return SECFailure;
|
return SECFailure;
|
||||||
}
|
}
|
||||||
|
|
||||||
(* handle->db->close)(handle->db);
|
(* handle->db->close)(handle->db);
|
||||||
handle->db = dbopen( handle->dbname, NO_CREATE, 0600, DB_HASH, 0 );
|
if (handle->appname) {
|
||||||
|
handle->db=rdbopen(handle->appname, handle->dbname, "key", NO_CREATE);
|
||||||
|
} else {
|
||||||
|
handle->db = dbopen( handle->dbname, NO_CREATE, 0600, DB_HASH, 0 );
|
||||||
|
}
|
||||||
if (handle->db == NULL) {
|
if (handle->db == NULL) {
|
||||||
/* set an error code */
|
/* set an error code */
|
||||||
return SECFailure;
|
return SECFailure;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
* may use your version of this file under either the MPL or the
|
* may use your version of this file under either the MPL or the
|
||||||
* GPL.
|
* GPL.
|
||||||
*
|
*
|
||||||
* $Id: keydbi.h,v 1.3 2001/12/07 01:36:18 relyea%netscape.com Exp $
|
* $Id: keydbi.h,v 1.4 2002/08/02 21:41:01 relyea%netscape.com Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _KEYDBI_H_
|
#ifndef _KEYDBI_H_
|
||||||
@ -50,6 +50,7 @@ struct NSSLOWKEYDBHandleStr {
|
|||||||
DB *updatedb; /* used when updating an old version */
|
DB *updatedb; /* used when updating an old version */
|
||||||
SECItem *global_salt; /* password hashing salt for this db */
|
SECItem *global_salt; /* password hashing salt for this db */
|
||||||
int version; /* version of the database */
|
int version; /* version of the database */
|
||||||
|
char *appname; /* multiaccess app name */
|
||||||
char *dbname; /* name of the openned DB */
|
char *dbname; /* name of the openned DB */
|
||||||
PRBool readOnly; /* is the DB read only */
|
PRBool readOnly; /* is the DB read only */
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user