From 9f37e93dd741a5436ff412955628806ae84725ca Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 11 Mar 2019 18:15:05 +0100 Subject: [PATCH] dirmngr: Avoid testing for Tor with --gpgconf-list. * dirmngr/dirmngr.c (post_option_parsing): Do not call set_tor_mode. (dirmngr_sighup_action): Call it here. (main): Call it here unless in --gpgconf-list mode. Signed-off-by: Werner Koch --- dirmngr/dirmngr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dirmngr/dirmngr.c b/dirmngr/dirmngr.c index 5b9e7a86e..3a99a2e2e 100644 --- a/dirmngr/dirmngr.c +++ b/dirmngr/dirmngr.c @@ -763,7 +763,6 @@ post_option_parsing (void) opt.connect_quick_timeout = opt.connect_timeout; set_debug (); - set_tor_mode (); } @@ -1090,7 +1089,12 @@ main (int argc, char **argv) log_printf ("\n"); } + /* Note that we do not run set_tor_mode in --gpgconf-list mode + * because it will attempt to connect to the tor client and that can + * be time consuming. */ post_option_parsing (); + if (cmd != aGPGConfTest && cmd != aGPGConfList) + set_tor_mode (); /* Get LDAP server list from file. */ #if USE_LDAP @@ -1864,6 +1868,7 @@ dirmngr_sighup_action (void) log_info (_("SIGHUP received - " "re-reading configuration and flushing caches\n")); reread_configuration (); + set_tor_mode (); cert_cache_deinit (0); crl_cache_deinit (); cert_cache_init (hkp_cacert_filenames);