This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/20826] Tests fail on hosts without network access
- From: "infinity0 at pwned dot gg" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 17 Nov 2016 14:27:06 +0000
- Subject: [Bug network/20826] Tests fail on hosts without network access
- Auto-submitted: auto-generated
- References: <bug-20826-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20826
--- Comment #2 from infinity0 at pwned dot gg ---
Aurelien the Debian maintainer suggests that "the real bug" is that
getaddrinfo("localhost.") tries to look this up via a network call rather than
resolving it from /etc/hosts. Indeed, if you explicitly add "localhost." to
/etc/hosts then the test succeeds.
Shorter version:
$ sudo iptables -I OUTPUT -m owner --gid-owner sbuild ! -d 127.0.0.0/8 -j DROP
$ sudo -u sbuild getent hosts localhost
$ sudo -u sbuild getent hosts localhost.
He suggests that libnss_files should resolve "localhost." using a "localhost"
entry in /etc/hosts. The more general version of this would be to resolve
absolute names, using relative entries in /etc/hosts.
To me, this sounds like quite a big behavioural change, even if it would be
technically easy to write the patch. So I don't know if it's the best fix here.
What do you all think?
In the meantime, anyone that is hit by this bug can work around it by adding
"localhost." to /etc/hosts.
--
You are receiving this mail because:
You are on the CC list for the bug.