From d8f0b83e4f04641e5e9adbdd8abada15380f981c Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 11 Oct 2013 09:25:58 +0200 Subject: gpg: Do not require a trustdb with --always-trust. * g10/tdbio.c (tdbio_set_dbname): Add arg R_NOFILE. * g10/trustdb.c (trustdb_args): Add field no_trustdb. (init_trustdb): Set that field. (revalidation_mark): Take care of a nonexistent trustdb file. (read_trust_options): Ditto. (tdb_get_ownertrust): Ditto. (tdb_get_min_ownertrust): Ditto. (tdb_update_ownertrust): Ditto. (update_min_ownertrust): Ditto. (tdb_clear_ownertrusts): Ditto. (tdb_cache_disabled_value): Ditto. (tdb_check_trustdb_stale): Ditto. (tdb_get_validity_core): Ditto. * g10/gpg.c (main): Do not create a trustdb with most commands for trust-model always. -- This slightly changes the semantics of most commands in that they won't create a trustdb if --trust-model=always is used. It just does not make sense to create a trustdb if there is no need for it. Signed-off-by: Werner Koch (cherry picked from commit 1a0eeaacd1bf09fe5125dbc3f56016bc20f3512e) Resolved conflicts: NEWS g10/trustdb.c: Manually apply changes due to changed function names. Note that this also includes the fix for clear_ownertrust, see GnuPG-bug-id: 1622. --- g10/gpg.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'g10/gpg.c') diff --git a/g10/gpg.c b/g10/gpg.c index 15cbe4bcc..65a9cab99 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -3539,15 +3539,11 @@ main (int argc, char **argv) case aListTrustDB: rc = setup_trustdb (argc? 1:0, trustdb_name); break; - case aEncr: - case aEncrFiles: + default: /* If we are using TM_ALWAYS, we do not need to create the trustdb. */ rc = setup_trustdb (opt.trust_model != TM_ALWAYS, trustdb_name); break; - default: - rc = setup_trustdb (1, trustdb_name ); - break; } if (rc) log_error (_("failed to initialize the TrustDB: %s\n"), g10_errstr(rc)); -- cgit v1.2.3