[git] GnuPG - branch, master, updated. gnupg-2.1.19-113-g5d873f2

by Werner Koch cvs at cvs.gnupg.org
Mon Apr 3 20:12:00 CEST 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  5d873f288e86edfb684f4dd57ac36466b06494a4 (commit)
      from  c6b5611c230daf738a3e913092c8976734179904 (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 5d873f288e86edfb684f4dd57ac36466b06494a4
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Apr 3 19:10:50 2017 +0200

    dirmngr: Do not assume that /etc/hosts exists.
    
    * dirmngr/dns-stuff.c (libdns_init): Do not bail out.
    --
    
    A standard Windows installation does not have a hosts file and thus we
    can't bail out here.  We should also not bail out on a Unix system
    because /etc/hosts is just one method in  nsswitch.conf.
    
    Fixes-commit: 88f1505f0613894d5544290a170119eb538921e5
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index 1a80913..a88e833 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -538,10 +538,9 @@ libdns_init (void)
       goto leave;
     }
 
-
   {
 #if HAVE_W32_SYSTEM
-    char *hosts_path = xtryasprintf ("%s\System32\drivers\etc\hosts",
+    char *hosts_path = xtryasprintf ("%s\\System32\\drivers\\etc\\hosts",
                                      getenv ("SystemRoot"));
     if (! hosts_path)
       {
@@ -551,15 +550,24 @@ 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));
-        goto leave;
+        err = 0; /* Do not bail out - having no /etc/hosts is legal.  */
       }
+#endif
   }
 
   /* dns_hints_local for stub mode, dns_hints_root for recursive.  */

-----------------------------------------------------------------------

Summary of changes:
 dirmngr/dns-stuff.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list