From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E4027385AE6C for ; Tue, 13 Sep 2022 14:35:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E4027385AE6C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663079752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZZA6KYNmA1Pa+2cw8W674PTu7n9KCuPcAbKJcHUhUo4=; b=HCNF6zaELQG1Ey2ePXL1D9MJiDmWcxrmCX7o7/Ah5mPwYAnhUehssi7yYZ8BkP99qX8DBN BE9hfvkpTR/Np+hXLWmJQdbZcmsp47Lwry0enCCdjK4C0CbV/GbM831izEcTWk80kAk6+j dwSDFAXwGijg4GxCFTdXF+FIq/qwAGA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-675-gytEIzkMPcKLKDBiOQwIRw-1; Tue, 13 Sep 2022 10:35:51 -0400 X-MC-Unique: gytEIzkMPcKLKDBiOQwIRw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EAAA6802529 for ; Tue, 13 Sep 2022 14:35:50 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.210]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3786A10EB8 for ; Tue, 13 Sep 2022 14:35:50 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 2/2] nss: Fix tst-nss-files-hosts-long on single-stack hosts (bug 24816) In-Reply-To: References: X-From-Line: 468dff5f8914e9db91785b32683ac0af1f4c731b Mon Sep 17 00:00:00 2001 Message-Id: <468dff5f8914e9db91785b32683ac0af1f4c731b.1663079342.git.fweimer@redhat.com> Date: Tue, 13 Sep 2022 16:35:48 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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. --- 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"); -- 2.37.2