From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Neon and reverse address lookup Date: Sat, 18 Jan 2014 22:32:31 +0100 Message-ID: <8738klou1c.fsf@gnu.org> References: <20140118124847.GA6166@debian> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45821) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4daG-0001OZ-Fs for guix-devel@gnu.org; Sat, 18 Jan 2014 16:37:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4daA-0000iS-W2 for guix-devel@gnu.org; Sat, 18 Jan 2014 16:37:40 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:59932) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4daA-0000iM-Ol for guix-devel@gnu.org; Sat, 18 Jan 2014 16:37:34 -0500 In-Reply-To: <20140118124847.GA6166@debian> (Andreas Enge's message of "Sat, 18 Jan 2014 13:48:47 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Andreas Enge Cc: guix-devel@gnu.org Andreas Enge skribis: > when trying to package the neon library: > http://www.webdav.org/neon/ , > the tests fail inside the chroot with > addr_reverse (reverse lookup for 127.0.0.1 failed) I just tried this and it fails with =E2=80=9CHost name lookup failure=E2=80= =9D: --8<---------------cut here---------------start------------->8--- #!/.../bin/guile -s !# (use-modules (guix) (guix monads)) (define (with-/etc/hosts?) (define b '(and (file-exists? "/etc/hosts") (pk 'gethostbyaddr (hostent:name (gethostbyaddr (inet-pton AF_INET "127.0.0.1")))) (call-with-output-file (assoc-ref %outputs "out") (const #t)))) (mlet* %store-monad ((d (derivation-expression "etc-hosts" b))) (built-derivations (list d)))) (let* ((s (open-connection))) (run-with-store s (with-/etc/hosts?))) --8<---------------cut here---------------end--------------->8--- So /etc/hosts is not enough for reverse lookups to work. With nscd turned off, I tried this: guile -c '(pk (gethostbyaddr (inet-pton AF_INET "127.0.0.1")))' If nsswitch.conf is removed, then that resolves to =E2=80=9Clocalhost=E2=80= =9D (instead of the actual host name.) If, in addition, resolv.conf is removed, then that fails as seen above. With nsswitch.conf alone, it resolves correctly (Mark was right.) And this works with only =E2=80=9Chosts: files=E2=80=9D in nsswitch.conf. It=E2=80=99s surprising that there=E2=80=99s this discrepancy between how N= SS works for getaddrinfo and for gethostbyaddr. At any rate, we may be able to solve this at the libc level. Thanks, Ludo=E2=80=99.