[git] GnuPG - branch, master, updated. gnupg-2.2.7-156-ga4a054b

by NIIBE Yutaka cvs at cvs.gnupg.org
Mon Jun 18 03:15:14 CEST 2018


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  a4a054bf14fa855715faee01a152755c4e2a74f7 (commit)
      from  bcdbf8b8ebe9d61160e0b007dabe1b6462ffbc93 (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 a4a054bf14fa855715faee01a152755c4e2a74f7
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Mon Jun 18 10:13:35 2018 +0900

    libdns: Fix for non-FQDN hostname.
    
    * dirmngr/dns.c (dns_resconf_open): Clear search[0] for non-FQDN
    hostname.
    
    --
    
    GnuPG-bug-id: T3803
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/dirmngr/dns.c b/dirmngr/dns.c
index d2445a0..908bf15 100644
--- a/dirmngr/dns.c
+++ b/dirmngr/dns.c
@@ -5371,13 +5371,16 @@ struct dns_resolv_conf *dns_resconf_open(int *error) {
 	if (0 != gethostname(resconf->search[0], sizeof resconf->search[0]))
 		goto syerr;
 
-	dns_d_anchor(resconf->search[0], sizeof resconf->search[0], resconf->search[0], strlen(resconf->search[0]));
-	dns_d_cleave(resconf->search[0], sizeof resconf->search[0], resconf->search[0], strlen(resconf->search[0]));
-
 	/*
-	 * XXX: If gethostname() returned a string without any label
-	 *      separator, then search[0][0] should be NUL.
+	 * If gethostname() returned a string without any label
+	 * separator, then search[0][0] should be NUL.
 	 */
+	if (strchr (resconf->search[0], '.')) {
+		dns_d_anchor(resconf->search[0], sizeof resconf->search[0], resconf->search[0], strlen(resconf->search[0]));
+		dns_d_cleave(resconf->search[0], sizeof resconf->search[0], resconf->search[0], strlen(resconf->search[0]));
+	} else {
+		memset (resconf->search[0], 0, sizeof resconf->search[0]);
+	}
 
 	dns_resconf_acquire(resconf);
 

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

Summary of changes:
 dirmngr/dns.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)


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




More information about the Gnupg-commits mailing list