1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

dirmngr: Always print a warning for a missing /etc/hosts.

* dirmngr/dns-stuff.c (libdns_init): No Windows specific handling of a
missing /etc/hosts.
--

My last comment on this was flawed.  Windows seems to always have its
version of /etc/hosts.  Only the en passant fixed bad escaping led me
assume that this was the case.  Thanks to Andre for complaining about
my comment remark.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2017-04-03 20:20:27 +02:00
parent 5d873f288e
commit 35c843c815
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -550,24 +550,15 @@ libdns_init (void)
derr = dns_hosts_loadpath (ld.hosts, hosts_path);
xfree (hosts_path);
if (derr)
{
err = libdns_error_to_gpg_error (derr);
/* Most Windows systems don't have a hosts files. So do not
* report in this case. */
if (gpg_err_code (err) != GPG_ERR_ENOENT)
log_error ("failed to load hosts file: %s\n", gpg_strerror (err));
err = 0; /* Do not bail out. */
}
#else
derr = dns_hosts_loadpath (ld.hosts, "/etc/hosts");
#endif
if (derr)
{
err = libdns_error_to_gpg_error (derr);
log_error ("failed to load hosts file: %s\n", gpg_strerror (err));
err = 0; /* Do not bail out - having no /etc/hosts is legal. */
}
#endif
}
/* dns_hints_local for stub mode, dns_hints_root for recursive. */