Update the version field in the handle when doing the automatic update.

git-svn-id: svn://10.0.0.236/trunk@118827 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
relyea%netscape.com
2002-04-12 03:43:34 +00:00
parent 893002ab40
commit 72e0339f45

View File

@@ -32,7 +32,7 @@
*
* Private Key Database code
*
* $Id: keydb.c,v 1.17 2002-04-11 00:59:42 relyea%netscape.com Exp $
* $Id: keydb.c,v 1.18 2002-04-12 03:43:34 relyea%netscape.com Exp $
*/
#include "lowkeyi.h"
@@ -892,10 +892,16 @@ newdb:
handle->db = rdbopen( appName, prefix, "key", NO_CREATE);
handle->updatedb = dbopen( dbname, NO_RDONLY, 0600, DB_HASH, 0 );
if (handle->updatedb) {
db_Copy(handle->db, handle->updatedb);
(*handle->updatedb->close)(handle->updatedb);
handle->updatedb = NULL;
goto done;
handle->version = nsslowkey_version(handle->updatedb);
if (handle->version != NSSLOWKEY_DB_FILE_VERSION) {
(*handle->updatedb->close)(handle->updatedb);
handle->updatedb = NULL;
} else {
db_Copy(handle->db, handle->updatedb);
(*handle->updatedb->close)(handle->updatedb);
handle->updatedb = NULL;
goto done;
}
}
} else {
handle->db = dbopen( dbname, NO_CREATE, 0600, DB_HASH, 0 );