aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-04-18 11:01:56 +0000
committerWerner Koch <[email protected]>2002-04-18 11:01:56 +0000
commit37c268ed6ac44240df35b47c74bb80ccfee8d598 (patch)
tree6cba3b50757d749fcb9612a0ecc88c6bc5698457
parent* getkey.c (lookup): Advance the searchmode after a search FIRST. (diff)
downloadgnupg-37c268ed6ac44240df35b47c74bb80ccfee8d598.tar.gz
gnupg-37c268ed6ac44240df35b47c74bb80ccfee8d598.zip
* trustdb.c (validate_keys): Never schedule a nextcheck into the
past.
-rw-r--r--g10/ChangeLog3
-rw-r--r--g10/trustdb.c11
2 files changed, 12 insertions, 2 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 7cd5f711e..00ae585c9 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,5 +1,8 @@
2002-04-18 Werner Koch <[email protected]>
+ * trustdb.c (validate_keys): Never schedule a nextcheck into the
+ past.
+
* getkey.c (premerge_public_with_secret): Fixed 0x12345678! syntax
for use with secret keys.
(lookup): Advance the searchmode after a search FIRST.
diff --git a/g10/trustdb.c b/g10/trustdb.c
index df49231d1..61d6d14ae 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -1338,8 +1338,9 @@ validate_keys (int interactive)
int key_count;
int ot_unknown, ot_undefined, ot_never, ot_marginal, ot_full, ot_ultimate;
KeyHashTable visited;
- u32 next_expire;
+ u32 start_time, next_expire;
+ start_time = make_timestamp ();
next_expire = 0xffffffff; /* set next expire to the year 2106 */
visited = new_key_hash_table ();
/* Fixme: Instead of always building a UTK list, we could just build it
@@ -1480,7 +1481,11 @@ validate_keys (int interactive)
release_key_hash_table (visited);
if (!rc && !quit) /* mark trustDB as checked */
{
- if (next_expire == 0xffffffff)
+ /* If there was an inconsistency in the trustdb it might happen
+ that the next_expire is set to the past; however at this point
+ we did checked it and thus we can flag the trustdb with no
+ schedule required. */
+ if (next_expire == 0xffffffff || next_expire < start_time )
tdbio_write_nextcheck (0);
else
{
@@ -1492,3 +1497,5 @@ validate_keys (int interactive)
}
return rc;
}
+
+