From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id DDA56385840F; Tue, 20 Sep 2022 11:32:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DDA56385840F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1663673547; bh=Qak38tKNrWxfOTktE0Znh0l/LxP0sK6b7+Pb6T8FfV8=; h=From:To:Subject:Date:From; b=cIcTKY64NHq2/Guy+rBAnCQEj+YD4Gy+Ick3ElsGgSR3phzTLRoQONVmGvtHTCla9 AolL9Tx3fGWIxA9Peyi4p8XBLpfLRgjYprBLXFQEiT94V9b84In+3wfDGGD0+UywZ9 D7EnS6S4ar+5+aaBgolSyQnnoOYJyvq3xTfzqMEo= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] nss: Fix tst-nss-files-hosts-long on single-stack hosts (bug 24816) X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: a623f13adfac47c8634a7288e08f821a846bc650 X-Git-Newrev: c75d20b5b27b0a60f0678236f51a4d3b0b058c00 Message-Id: <20220920113227.DDA56385840F@sourceware.org> Date: Tue, 20 Sep 2022 11:32:27 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c75d20b5b27b0a60f0678236f51a4d3b0b058c00 commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00 Author: Florian Weimer Date: Tue Sep 13 16:11:40 2022 +0200 nss: Fix tst-nss-files-hosts-long on single-stack hosts (bug 24816) getent implicitly passes AI_ADDRCONFIG to getaddrinfo by default. Use --no-addrconfig to suppress that, so that both IPv4 and IPv6 lookups succeed even if the address family is not supported by the host. Reviewed-by: Carlos O'Donell Diff: --- nss/tst-nss-files-hosts-long.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nss/tst-nss-files-hosts-long.c b/nss/tst-nss-files-hosts-long.c index 3942cf5fca..a7697e3143 100644 --- a/nss/tst-nss-files-hosts-long.c +++ b/nss/tst-nss-files-hosts-long.c @@ -28,14 +28,15 @@ do_test (void) { int ret; - /* Run getent to fetch the IPv4 address for host test4. - This forces /etc/hosts to be parsed. */ - ret = system("getent ahostsv4 test4"); + /* Run getent to fetch the IPv4 address for host test4. This forces + /etc/hosts to be parsed. Use --no-addrconfig to return addresses + even in an IPv6-only environment. */ + ret = system("getent --no-addrconfig ahostsv4 test4"); if (ret != 0) FAIL_EXIT1("ahostsv4 failed"); /* Likewise for IPv6. */ - ret = system("getent ahostsv6 test6"); + ret = system("getent --no-addrconfig ahostsv6 test6"); if (ret != 0) FAIL_EXIT1("ahostsv6 failed");