From deee8147aab086161c91e6aa6fb41d7148a630f6 Mon Sep 17 00:00:00 2001 From: David Shaw Date: Thu, 19 Jan 2012 22:33:51 -0500 Subject: Changes to --min-cert-level should cause a trustdb rebuild (issue 1366) * g10/gpgv.c, g10/trustdb.c (read_trust_options): Add min_cert_level * g10/trustdb.c (check_trustdb_stale): Request a rebuild if pending_check_trustdb is true (set when we detect a trustdb parameter has changed). * g10/keylist.c (public_key_list): Use 'l' in the "tru" with-colons listing for min_cert_level not matching. * g10/tdbio.c (tdbio_update_version_record, create_version_record, tdbio_db_matches_options, tdbio_dump_record, tdbio_read_record, tdbio_write_record): Add a byte for min_cert_level in the tdbio version record. --- g10/trustdb.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'g10/trustdb.c') diff --git a/g10/trustdb.c b/g10/trustdb.c index 006db04f4..63b03c4f7 100644 --- a/g10/trustdb.c +++ b/g10/trustdb.c @@ -1,6 +1,6 @@ /* trustdb.c * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, - * 2008 Free Software Foundation, Inc. + * 2008, 2012 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -658,7 +658,8 @@ trustdb_check_or_update(void) void read_trust_options(byte *trust_model,ulong *created,ulong *nextcheck, - byte *marginals,byte *completes,byte *cert_depth) + byte *marginals,byte *completes,byte *cert_depth, + byte *min_cert_level) { TRUSTREC opts; @@ -678,6 +679,8 @@ read_trust_options(byte *trust_model,ulong *created,ulong *nextcheck, *completes=opts.r.ver.completes; if(cert_depth) *cert_depth=opts.r.ver.cert_depth; + if(min_cert_level) + *min_cert_level=opts.r.ver.min_cert_level; } /*********************************************** @@ -1042,7 +1045,8 @@ check_trustdb_stale(void) did_nextcheck = 1; scheduled = tdbio_read_nextcheck (); - if (scheduled && scheduled <= make_timestamp ()) + if ((scheduled && scheduled <= make_timestamp ()) + || pending_check_trustdb) { if (opt.no_auto_check_trustdb) { -- cgit v1.2.3