mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
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@fsij.org>
This commit is contained in:
parent
bcdbf8b8eb
commit
a4a054bf14
@ -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
|
||||
* 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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user