1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

gpg: Print a warning on Tor problems.

* dirmngr/ks-engine-hkp.c (tor_not_running_p): New.
(map_host): Call that to print a warning.
(handle_send_request_error): Ditto and avoid marking the host dead.
Also print a tor_config_problem warning.  Add arg CTRL; adjust callers
to pass that new arg.
* g10/call-dirmngr.c (ks_status_cb): Detect and print the new
warnings.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-01-24 20:45:31 +01:00
parent 51e5a5e5a4
commit 770b75a746
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
2 changed files with 70 additions and 16 deletions

View file

@ -374,7 +374,8 @@ ks_status_cb (void *opaque, const char *line)
{
struct ks_status_parm_s *parm = opaque;
gpg_error_t err = 0;
const char *s;
const char *s, *s2;
const char *warn;
if ((s = has_leading_keyword (line, parm->keyword? parm->keyword : "SOURCE")))
{
@ -385,6 +386,29 @@ ks_status_cb (void *opaque, const char *line)
err = gpg_error_from_syserror ();
}
}
else if ((s = has_leading_keyword (line, "WARNING")))
{
if ((s2 = has_leading_keyword (s, "tor_not_running")))
warn = _("Tor is not running");
else if ((s2 = has_leading_keyword (s, "tor_config_problem")))
warn = _("Tor is not properly configured");
else
warn = NULL;
if (warn)
{
log_info (_("WARNING: %s\n"), warn);
if (s2)
{
while (*s2 && !spacep (s2))
s2++;
while (*s2 && spacep (s2))
s2++;
if (*s2)
print_further_info ("%s", s2);
}
}
}
return err;
}