From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.2 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 750AB1F8C6 for ; Thu, 15 Jul 2021 05:19:57 +0000 (UTC) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A395939DC4F6 for ; Thu, 15 Jul 2021 05:19:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A395939DC4F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1626326396; bh=1jOTb642yYuynArcZ9cRnnsEnhTord/oMy8Fp74wSog=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=hx41FC3z5pUjSsXuB54vEP1tdHWldY1ewAX4SQ4C+M62zRROitdDeg8XbJjbW8vo3 ki7NWn0CFwFxvfoY4qo4yJZPY8Qbs9bk1ohsurZkho1sgL9hWMaK2XtG0yYfqPwqvs Dz6EVo23udKPkLkBBZn+Cw6XHkbKGSA0BHYc3odw= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 273B339A28CD for ; Thu, 15 Jul 2021 05:02:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 273B339A28CD Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-224-DBR2TcgvMCala-Hihd6QzA-1; Thu, 15 Jul 2021 01:02:17 -0400 X-MC-Unique: DBR2TcgvMCala-Hihd6QzA-1 Received: by mail-qk1-f199.google.com with SMTP id x12-20020a05620a448cb02903b3dabbe857so2873433qkp.15 for ; Wed, 14 Jul 2021 22:02:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=1jOTb642yYuynArcZ9cRnnsEnhTord/oMy8Fp74wSog=; b=CvAuimD/7BTFCil8oAb5R6HuDIB8Bmlr3NCLEYDuu9iKTJRgSP1BHPh3DO06zfykTo wfqhTrvdoAdpzAYz5Xpa5oSUc6AtP7Spmpm5GdbGPAe/jaaSH3R6OdaDSQEOBTNezmhp 8/dr/ZVp9ehsljrCOoDMVUFo3ilJ0Pmt9qNnEKJ5iuFAOUs1P9QAv89RzuJdXJwPxlsv /h9uOia7LtSlhe4abPker0MRC50Z2oGCGGerdPDvdrkIFJYkZTLhbSy1TR94+ZxrPnx9 OgHTkM/srXwfHam7fFqwkYYdruAJgwuH05Y7H3CDbS43sx8SZ33Oqf6FPIUC5x5kSnXF +TZA== X-Gm-Message-State: AOAM531C61lyL9JBRobIDcCTa5PvqLYivexITc+gd2UPwMO4j4zV8QiU NLDOf5L95BDQ12o2XPTRUKdl2JtzjmZEQm/x1nIJQ7r8lMi7lpFZXqXaOMs60vDkh0aPmnF9Eih a/SBjJ/CmgbQvuJr382tU/U0KvLEUR29otjINouknb5lPpjIbSEF/r6RtuT62cHNMhKBkFw== X-Received: by 2002:a05:620a:62d:: with SMTP id 13mr372733qkv.18.1626325337197; Wed, 14 Jul 2021 22:02:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzhLaMpoFdliUUQWGPB3Qo7PEk82UtDcXk3Auk0gJ2lObghkdAsLpWEZjXu1R1J7sSCEt7JZw== X-Received: by 2002:a05:620a:62d:: with SMTP id 13mr372711qkv.18.1626325336992; Wed, 14 Jul 2021 22:02:16 -0700 (PDT) Received: from [192.168.1.16] (198-84-214-74.cpe.teksavvy.com. [198.84.214.74]) by smtp.gmail.com with ESMTPSA id e12sm1730676qtj.3.2021.07.14.22.02.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jul 2021 22:02:16 -0700 (PDT) Subject: Re: [PATCH 25/30] resolv: Move res_hostalias into its own file, along with hostalias To: Florian Weimer , libc-alpha@sourceware.org References: <2859cbe6705cdc430d0d5e200224e5e9503eea86.1625755446.git.fweimer@redhat.com> Organization: Red Hat Message-ID: Date: Thu, 15 Jul 2021 01:02:15 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <2859cbe6705cdc430d0d5e200224e5e9503eea86.1625755446.git.fweimer@redhat.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Carlos O'Donell via Libc-alpha Reply-To: Carlos O'Donell Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 7/8/21 11:06 AM, Florian Weimer via Libc-alpha wrote: > These deprecated symbols continue to be exported from libresolv. OK for glibc 2.34. Tested without regression on x86_64 and i686. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell > --- > resolv/Makefile | 1 + > resolv/res_hostalias.c | 51 ++++++++++++++++++++++++++++++++++++++++++ > resolv/res_query.c | 30 ------------------------- > 3 files changed, 52 insertions(+), 30 deletions(-) > create mode 100644 resolv/res_hostalias.c > > diff --git a/resolv/Makefile b/resolv/Makefile > index bfcca70f26..8c28afe5c4 100644 > --- a/resolv/Makefile > +++ b/resolv/Makefile > @@ -152,6 +152,7 @@ libresolv-routines := \ > res_data \ > res_debug \ > res_enable_icmp \ > + res_hostalias \ OK. > res_isourserver \ > res_mkquery \ > res_query \ > diff --git a/resolv/res_hostalias.c b/resolv/res_hostalias.c > new file mode 100644 > index 0000000000..d364725677 > --- /dev/null > +++ b/resolv/res_hostalias.c > @@ -0,0 +1,51 @@ > +/* HOSTALIASES-based name resolution. Public legacy functions. OK. > + Copyright (C) 2017-2021 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#include > +#include > +#include > + > +/* Common part of res_hostalias and hostalias. */ > +static const char * > +context_hostalias_common (struct resolv_context *ctx, > + const char *name, char *dst, size_t siz) > +{ > + if (ctx == NULL) > + { > + RES_SET_H_ERRNO (&_res, NETDB_INTERNAL); > + return NULL; > + } > + const char *result = __res_context_hostalias (ctx, name, dst, siz); > + __resolv_context_put (ctx); > + return result; OK. > +} > + > +const char * > +res_hostalias (res_state statp, const char *name, char *dst, size_t siz) > +{ > + return context_hostalias_common > + (__resolv_context_get_override (statp), name, dst, siz); OK. > +} > + > +const char * > +hostalias (const char *name) > +{ > + static char abuf[MAXDNAME]; > + return context_hostalias_common > + (__resolv_context_get (), name, abuf, sizeof (abuf)); OK. > +} > diff --git a/resolv/res_query.c b/resolv/res_query.c > index 45c591ae27..2457193d31 100644 > --- a/resolv/res_query.c > +++ b/resolv/res_query.c > @@ -635,36 +635,6 @@ res_querydomain (const char *name, const char *domain, int class, int type, > (__resolv_context_get (), name, domain, class, type, answer, anslen); > } > > -/* Common part of res_hostalias and hostalias. */ > -static const char * > -context_hostalias_common (struct resolv_context *ctx, > - const char *name, char *dst, size_t siz) > -{ > - if (ctx == NULL) > - { > - RES_SET_H_ERRNO (&_res, NETDB_INTERNAL); > - return NULL; > - } > - const char *result = __res_context_hostalias (ctx, name, dst, siz); > - __resolv_context_put (ctx); > - return result; > -} OK. Remove. > - > -const char * > -res_hostalias (res_state statp, const char *name, char *dst, size_t siz) > -{ > - return context_hostalias_common > - (__resolv_context_get_override (statp), name, dst, siz); > -} OK. Remove. > - > -const char * > -hostalias (const char *name) > -{ > - static char abuf[MAXDNAME]; > - return context_hostalias_common > - (__resolv_context_get (), name, abuf, sizeof (abuf)); > -} > - OK. Remove. > #if SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2) > # undef res_query > # undef res_querydomain > -- Cheers, Carlos.