aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2002-12-04 06:06:56 +0000
committerDavid Shaw <[email protected]>2002-12-04 06:06:56 +0000
commit60fce379da1198688eeec996e12eebabd067a2ed (patch)
tree3970a2ec1f6e2e088450a41df19e49d2c698b13c /g10/trustdb.c
parent* tdbio.h, tdbio.c (tdbio_read_record, tdbio_write_record): Store trust (diff)
downloadgnupg-60fce379da1198688eeec996e12eebabd067a2ed.tar.gz
gnupg-60fce379da1198688eeec996e12eebabd067a2ed.zip
* trustdb.c (validate_keys): Show trust parameters when building trustdb,
and make sure that the version record update was successful. (init_trustdb): If the current parameters aren't what was used for building the trustdb, the trustdb is invalid. * tbio.c (tdbio_db_matches_options): Update to work with new trustdbs.
Diffstat (limited to '')
-rw-r--r--g10/trustdb.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index 8c732bb99..a49de5ea0 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -424,6 +424,9 @@ init_trustdb()
BUG();
if( rc )
log_fatal("can't init trustdb: %s\n", g10_errstr(rc) );
+
+ if(!tdbio_db_matches_options())
+ pending_check_trustdb=1;
}
@@ -1776,6 +1779,11 @@ validate_keys (int interactive)
klist = utk_list;
kdb = keydb_new (0);
+ log_info(_("%d marginal(s) needed, %d complete(s) needed, %s trust model\n"),
+ opt.marginals_needed,opt.completes_needed,
+ opt.trust_model==TM_CLASSIC?"Classic":
+ opt.trust_model==TM_OPENPGP?"OpenPGP":"unknown");
+
for (depth=0; depth < opt.max_cert_depth; depth++)
{
/* See whether we should assign ownertrust values to the keys in
@@ -1912,7 +1920,14 @@ validate_keys (int interactive)
log_info (_("next trustdb check due at %s\n"),
strtimestamp (next_expire));
}
- tdbio_update_version_record();
+
+ if(tdbio_update_version_record()!=0)
+ {
+ log_error(_("unable to update trustdb version record: "
+ "write failed: %s\n"), g10_errstr(rc));
+ tdbio_invalid();
+ }
+
do_sync ();
pending_check_trustdb = 0;
}