chiark / gitweb /
Import gnupg2_2.1.18-8~deb9u1.debian.tar.bz2
[gnupg2.git] / patches / 0061-dirmngr-Always-print-a-warning-for-a-missing-etc-hos.patch
1 From: Werner Koch <wk@gnupg.org>
2 Date: Mon, 3 Apr 2017 20:20:27 +0200
3 Subject: dirmngr: Always print a warning for a missing /etc/hosts.
4
5 * dirmngr/dns-stuff.c (libdns_init): No Windows specific handling of a
6 missing /etc/hosts.
7 --
8
9 My last comment on this was flawed.  Windows seems to always have its
10 version of /etc/hosts.  Only the en passant fixed bad escaping led me
11 assume that this was the case.  Thanks to Andre for complaining about
12 my comment remark.
13
14 Signed-off-by: Werner Koch <wk@gnupg.org>
15 (cherry picked from commit 35c843c815306f36d1efbc52f5e2f6bac3f67aec)
16 ---
17  dirmngr/dns-stuff.c | 11 +----------
18  1 file changed, 1 insertion(+), 10 deletions(-)
19
20 diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
21 index c2d5488..150237e 100644
22 --- a/dirmngr/dns-stuff.c
23 +++ b/dirmngr/dns-stuff.c
24 @@ -550,24 +550,15 @@ libdns_init (void)
25  
26      derr = dns_hosts_loadpath (ld.hosts, hosts_path);
27      xfree (hosts_path);
28 -    if (derr)
29 -      {
30 -        err = libdns_error_to_gpg_error (derr);
31 -        /* Most Windows systems don't have a hosts files.  So do not
32 -         * report in this case.  */
33 -        if (gpg_err_code (err) != GPG_ERR_ENOENT)
34 -          log_error ("failed to load hosts file: %s\n", gpg_strerror (err));
35 -        err = 0; /* Do not bail out.  */
36 -      }
37  #else
38      derr = dns_hosts_loadpath (ld.hosts, "/etc/hosts");
39 +#endif
40      if (derr)
41        {
42          err = libdns_error_to_gpg_error (derr);
43          log_error ("failed to load hosts file: %s\n", gpg_strerror (err));
44          err = 0; /* Do not bail out - having no /etc/hosts is legal.  */
45        }
46 -#endif
47    }
48  
49    /* dns_hints_local for stub mode, dns_hints_root for recursive.  */