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 5F0A53851425 for ; Thu, 15 Sep 2022 12:11:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F0A53851425 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=1663243872; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0OZKUfgOnolbsHLNKPhzlAmM2gsWjocOPT+Ca9KXwTU=; b=Oa0UffKZ7RVkssxrM9cLXB1voxV79poTtamef+6j+Dt8dnF6PFtcdxPGhT2xNc/Dy9e3Nn pAYC+OfhrgjB6YJY6JARf3pUwwKsbrnY85Bz/Ps+H4jV1T+XP8c+/gd6BzrofmvFrSq18P IU5w9rKxSUNl+zyTW4KPWSj24FdSNhw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-349-_NXks1HDPmSu33mdpyIlVA-1; Thu, 15 Sep 2022 08:11:11 -0400 X-MC-Unique: _NXks1HDPmSu33mdpyIlVA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 591823C0D18E for ; Thu, 15 Sep 2022 12:11:11 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.194.198]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AB3D0492CA2; Thu, 15 Sep 2022 12:11:10 +0000 (UTC) From: Florian Weimer To: Carlos O'Donell Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 1/2] nss: Implement --no-addrconfig option for getent References: <462265b0ce37bd57b9304d873e9bccdb1cc4a199.1663079342.git.fweimer@redhat.com> Date: Thu, 15 Sep 2022 14:11:08 +0200 In-Reply-To: (Carlos O'Donell's message of "Wed, 14 Sep 2022 18:34:07 -0400") Message-ID: <87r10ckfc3.fsf@oldenburg.str.redhat.com> 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.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.5 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 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: * Carlos O'Donell: > On Tue, Sep 13, 2022 at 04:35:44PM +0200, Florian Weimer via Libc-alpha wrote: >> The ahosts, ahostsv4, ahostsv6 commands unconditionally pass >> AI_ADDRCONFIG to getaddrinfo, which is not always desired. > > Looking forward to a v2. > >> --- >> NEWS | 5 ++++- >> nss/getent.c | 11 ++++++++++- >> 2 files changed, 14 insertions(+), 2 deletions(-) >> >> diff --git a/NEWS b/NEWS >> index ef274d1a42..d4739d93c6 100644 >> --- a/NEWS >> +++ b/NEWS >> @@ -9,7 +9,10 @@ Version 2.37 >> >> Major new features: >> >> - [Add new features here] > > Suggest: > > * The getent tool now supports the --no-addrconfig option. The > output of getent with --no-addrconfig may contain addresses > of families not configured on the current host i.e. as-if you > had not passed AI_ADDRCONFIG to getaddrinfo calls. This flag > is primarily intended for diagnostic purposes. > > I think the use for diagnostics should be called out. I think getent ahosts* is mostly intended for diagnostic purposes anyway, so we don't have to spell this out again. The output format is certainly awkward for most purposes. So I'll use your text without the last sentence. >> +* The getent tool now supports the --no-addrconfig option. When >> + present, getent no longer passes AI_ADDRCONFIG to the getaddrinfo >> + function, and the output may contain addresses of families not >> + configured on the current host. >> >> Deprecated and removed features, and other changes affecting compatibility: >> >> diff --git a/nss/getent.c b/nss/getent.c >> index 8178b4b470..39a42e707d 100644 >> --- a/nss/getent.c >> +++ b/nss/getent.c >> @@ -58,6 +58,8 @@ static const struct argp_option args_options[] = >> { >> { "service", 's', N_("CONFIG"), 0, N_("Service configuration to be used") }, >> { "no-idn", 'i', NULL, 0, N_("disable IDN encoding") }, >> + { "no-addrconfig", 'A', NULL, 0, >> + N_("disable AI_ADDRCONFIG (for ahosts*)") }, > > Suggest a more user-center textual description: > > "disable filtering using host address configuration (for ahosts*)" > > It's a bit of a mouthfull. I'm going with this instead: N_("do not filter out unsupported IPv4/IPv6 addresses (with ahosts*)") }, Thanks, Florian