From 72e0339f4570e3ebef908dd60f21dd944302ca77 Mon Sep 17 00:00:00 2001 From: "relyea%netscape.com" Date: Fri, 12 Apr 2002 03:43:34 +0000 Subject: [PATCH] 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 --- mozilla/security/nss/lib/softoken/keydb.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/mozilla/security/nss/lib/softoken/keydb.c b/mozilla/security/nss/lib/softoken/keydb.c index 0ad77fbb7a5..8b069e917b2 100644 --- a/mozilla/security/nss/lib/softoken/keydb.c +++ b/mozilla/security/nss/lib/softoken/keydb.c @@ -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 );