From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 770323858283; Fri, 14 Oct 2022 11:03:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 770323858283 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665745382; bh=QslLCRVSvhixaxbZqIa7dv7NFhsrkBUl2LsmMdmZUaQ=; h=From:To:Subject:Date:From; b=lg3Pq8HnavvbQs+12IRa7zzt9+NRgOyB7O+2FLOe12xFCGFybmcxDPQcY+d7Ku049 BdthU+nvmlZdw1Z/B7gKdYTal+1f7YjLvuAmD38coS7wr6Jg3iQDZ34DwvoE1lvk1E ar0pZfYIDiAJIIxRRKkp3O6RxlNcMHlM+yHnOzYA= 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/release/2.34/master] 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/release/2.34/master X-Git-Oldrev: c95ef423d78d9a2ec0a8e4141c78165434685c6f X-Git-Newrev: 16c7ed6e68c13e5a5efd8ab464ebf9d07b4b0bb3 Message-Id: <20221014110302.770323858283@sourceware.org> Date: Fri, 14 Oct 2022 11:03:02 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=16c7ed6e68c13e5a5efd8ab464ebf9d07b4b0bb3 commit 16c7ed6e68c13e5a5efd8ab464ebf9d07b4b0bb3 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 (cherry picked from commit c75d20b5b27b0a60f0678236f51a4d3b0b058c00) Diff: --- NEWS | 1 + nss/tst-nss-files-hosts-long.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 60dcd893da..08a11329c0 100644 --- a/NEWS +++ b/NEWS @@ -55,6 +55,7 @@ The following bugs are resolved with this release: [19193] nptl: pthread_kill, pthread_cancel should not fail after exit [22542] CVE-2022-23219: Buffer overflow in sunrpc clnt_create for "unix" [23734] la_symbind*() doesn't get called when LD_BIND_NOW is set + [24816] Fix tst-nss-files-hosts-long on single-stack hosts [25812] Libio vtable protection is sometimes only partially enforced [26643] register x8 and quad sized NEON registers are not properly saved when using ld_audit on aarch64 diff --git a/nss/tst-nss-files-hosts-long.c b/nss/tst-nss-files-hosts-long.c index 00f8bea409..42676ba405 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");