[git] GnuPG - branch, master, updated. gnupg-2.1.19-69-g483c128
by Justus Winter
cvs at cvs.gnupg.org
Tue Mar 21 14:23:31 CET 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, master has been updated
via 483c1288a8f86dc6bf93d0d3f2865ecc246aecba (commit)
via 88f1505f0613894d5544290a170119eb538921e5 (commit)
from 06f1f163e96f1039304fd3cf565cf9de1ca45849 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 483c1288a8f86dc6bf93d0d3f2865ecc246aecba
Author: Justus Winter <justus at g10code.com>
Date: Tue Mar 21 14:22:13 2017 +0100
dirmngr: Fix error handling.
* dirmngr/dns-stuff.c (libdns_init): Convert error before printing it.
Signed-off-by: Justus Winter <justus at g10code.com>
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index 78c70e1..1a80913 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -568,8 +568,8 @@ libdns_init (void)
: dns_hints_local (ld.resolv_conf, &derr));
if (!ld.hints)
{
- log_error ("failed to load DNS hints: %s\n", gpg_strerror (err));
err = libdns_error_to_gpg_error (derr);
+ log_error ("failed to load DNS hints: %s\n", gpg_strerror (err));
goto leave;
}
commit 88f1505f0613894d5544290a170119eb538921e5
Author: Justus Winter <justus at g10code.com>
Date: Tue Mar 21 14:18:25 2017 +0100
dirmngr: Load the hosts file into libdns.
* dirmngr/dns-stuff.c (libdns_init): Actually load the hosts file into
libdns.
--
Previously, connecting to key servers specified in /etc/hosts was not
possible because libdns' hosts structure was initialized, but not
filled with the content of the hosts file.
GnuPG-bug-id: 2977
Signed-off-by: Justus Winter <justus at g10code.com>
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index ec9a095..78c70e1 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -533,11 +533,35 @@ libdns_init (void)
ld.hosts = dns_hosts_open (&derr);
if (!ld.hosts)
{
- log_error ("failed to load hosts file: %s\n", gpg_strerror (err));
err = libdns_error_to_gpg_error (derr);
+ log_error ("failed to initialize hosts file: %s\n", gpg_strerror (err));
goto leave;
}
+
+ {
+#if HAVE_W32_SYSTEM
+ char *hosts_path = xtryasprintf ("%s\System32\drivers\etc\hosts",
+ getenv ("SystemRoot"));
+ if (! hosts_path)
+ {
+ err = gpg_error_from_syserror ();
+ goto leave;
+ }
+
+ derr = dns_hosts_loadpath (ld.hosts, hosts_path);
+ xfree (hosts_path);
+#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));
+ goto leave;
+ }
+ }
+
/* dns_hints_local for stub mode, dns_hints_root for recursive. */
ld.hints = (recursive_resolver
? dns_hints_root (ld.resolv_conf, &derr)
-----------------------------------------------------------------------
Summary of changes:
dirmngr/dns-stuff.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list