This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug network/20826] Tests fail on hosts without network access


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]