1 From: NIIBE Yutaka <gniibe@fsij.org>
2 Date: Fri, 23 Dec 2016 16:05:01 +0900
3 Subject: dirmngr: Fix for --disable-libdns usage.
5 * dirmngr/dns-stuff.c (enable_recursive_resolver, set_dns_nameserver)
6 (reload_dns_stuff): Conditionalize with USE_LIBDNS.
7 (get_h_errno_as_gpg_error): Map HOST_NOT_FOUND to GPG_ERR_NO_NAME.
11 get_dns_srv assumes error code of GPG_ERR_NO_NAME when no SRV record
14 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
16 (cherry picked from commit d26c51825e2255fe58305cbc1cd74fa43f80d93e)
18 dirmngr/dns-stuff.c | 12 +++++++++---
19 1 file changed, 9 insertions(+), 3 deletions(-)
21 diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
22 index 491fccefd..a31b0731c 100644
23 --- a/dirmngr/dns-stuff.c
24 +++ b/dirmngr/dns-stuff.c
25 @@ -181,7 +181,9 @@ void
26 enable_recursive_resolver (int yes)
28 recursive_resolver = yes;
30 libdns_reinit_pending = 1;
35 @@ -251,8 +253,10 @@ set_dns_nameserver (const char *ipaddr)
36 strncpy (tor_nameserver, ipaddr? ipaddr : DEFAULT_NAMESERVER,
37 sizeof tor_nameserver -1);
38 tor_nameserver[sizeof tor_nameserver -1] = 0;
40 libdns_reinit_pending = 1;
41 libdns_tor_port = 0; /* Start again with the default port. */
46 @@ -278,7 +282,7 @@ get_h_errno_as_gpg_error (void)
50 - case HOST_NOT_FOUND: ec = GPG_ERR_UNKNOWN_HOST; break;
51 + case HOST_NOT_FOUND: ec = GPG_ERR_NO_NAME; break;
52 case TRY_AGAIN: ec = GPG_ERR_TRY_LATER; break;
53 case NO_RECOVERY: ec = GPG_ERR_SERVER_FAILED; break;
54 case NO_DATA: ec = GPG_ERR_NO_DATA; break;
55 @@ -534,15 +538,17 @@ libdns_deinit (void)
57 reload_dns_stuff (int force)
65 libdns_reinit_pending = 0;
68 libdns_reinit_pending = 1;