[Pkg-gnupg-commit] [gnupg2] 99/116: dirmngr: Handle missing nsswitch.conf.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Tue Jan 24 04:40:58 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit 88ade475c56ac3712d6bd6d41ae38e1421dcb320
Author: Phil Pennock <gnupg-devel at spodhuis.org>
Date: Thu Jan 19 01:21:42 2017 -0500
dirmngr: Handle missing nsswitch.conf.
* dirmngr/dns-stuff.c (libdns_init): Fallback to files,dns.
--
Signed-off-by: Phil Pennock <phil at pennock-tech.com>
ChangeLog entry by wk.
This fixed the problem:
Short version: macOS doesn't include /etc/nsswitch.conf and GnuPG's
dirmngr is hard-erroring when that file is missing, such that no DNS
operations succeed and --recv-key returns ENOENT type errors to the
caller.
Signed-off-by: Werner Koch <wk at gnupg.org>
---
dirmngr/dns-stuff.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/dirmngr/dns-stuff.c b/dirmngr/dns-stuff.c
index 28ecb18..eae888b 100644
--- a/dirmngr/dns-stuff.c
+++ b/dirmngr/dns-stuff.c
@@ -478,7 +478,16 @@ libdns_init (void)
if (err)
{
log_error ("failed to load '%s': %s\n", fname, gpg_strerror (err));
- goto leave;
+ /* not fatal, nsswitch.conf is not used on all systems; assume
+ * classic behavior instead. Our dns library states "bf" which tries
+ * DNS then Files, which is not classic; FreeBSD
+ * /usr/src/lib/libc/net/gethostnamadr.c defines default_src[] which
+ * is Files then DNS, which is. */
+ log_debug ("dns: fallback resolution order, files then DNS");
+ ld.resolv_conf->lookup[0] = 'f';
+ ld.resolv_conf->lookup[1] = 'b';
+ ld.resolv_conf->lookup[2] = '\0';
+ err = GPG_ERR_NO_ERROR;
}
#endif /* Unix */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list