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: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 4BB251F45E for ; Thu, 13 Feb 2020 09:01:42 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; q=dns; s=default; b=Qf+Y332ap7ZQMmOy0kcB0zxoQCsKsRmvk8MDMb2ZFOf 142EzCCXAdKUdBzJvd31+d9Zls2xV0ggzF898RhMC51L2+jt78qsdcAIXk6n+gku tn1xkfqMu5nwgRxqnRYBir1ynsITrvyt9Q4gSboIirkAvVVGsSauOa8ykzzdgCg0 = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:references:date:in-reply-to :message-id:mime-version:content-type:content-transfer-encoding; s=default; bh=xx4VsKOBsR5zi8dBfTsgUQRjAxE=; b=Eu80Q0M1bDvqpseiM 9QYnTpgXBNMBC/C4x68rBQa/BwNofYn1W38Pst/sCMCg8Lwu90VC/h9P7hmHctk8 k7/FaqcgTn5ZSUx0DE8ngMXcr8EZPC47vLkLfxoSweUhmIw2h6rnytKeKRT1Udkp OLnuYJScH//f5O/gPc118KNDHc= Received: (qmail 23858 invoked by alias); 13 Feb 2020 09:01:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 23835 invoked by uid 89); 13 Feb 2020 09:01:38 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: us-smtp-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581584496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CJQOflJkpyqGfFHnjZNI+9/BtO/xeqB14WHkhK5Wu90=; b=dFKwzfQqiB+yjMH26SAR0lAvAU5nn9vHoWXZntTc7NBXJw+xzQIDAcE1Cwe4Jm0Jd6Woe4 vzYC2f8AaUY0pwJ/+OUgpPtLDkzYGD9Fm0/yKTUVSublzWWJBn3qvTJO6ejBxOxN5ritMn dVxVEYyt9RSfXi3B937ZpBA22jf/dJk= From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 9/7] nss_nis: Use NSS_DECLARE_MODULE_FUNCTIONS References: Date: Thu, 13 Feb 2020 10:01:30 +0100 In-Reply-To: (Florian Weimer's message of "Wed, 12 Feb 2020 15:34:14 +0100") Message-ID: <875zgadfo5.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable This commit removes the minor optimization based on strong aliases because it loses type safety. ----- nis/nss-nis.h | 1 + nis/nss_nis/nis-hosts.c | 13 ++++++++----- nis/nss_nis/nis-network.c | 15 ++++++++++----- nis/nss_nis/nis-spwd.c | 13 +++++++++---- 4 files changed, 28 insertions(+), 14 deletions(-) diff --git a/nis/nss-nis.h b/nis/nss-nis.h index dc091d1a20..7c009d7e87 100644 --- a/nis/nss-nis.h +++ b/nis/nss-nis.h @@ -22,6 +22,7 @@ =20 #include "nsswitch.h" =20 +NSS_DECLARE_MODULE_FUNCTIONS (nis) =20 /* Convert YP error number to NSS error number. */ extern const enum nss_status __yperr2nss_tab[] attribute_hidden; diff --git a/nis/nss_nis/nis-hosts.c b/nis/nss_nis/nis-hosts.c index 2d08076382..1ee5444cfc 100644 --- a/nis/nss_nis/nis-hosts.c +++ b/nis/nss_nis/nis-hosts.c @@ -90,9 +90,16 @@ static bool_t new_start =3D 1; static char *oldkey =3D NULL; static int oldkeylen =3D 0; =20 +hidden_proto (_nss_nis_endhostent) =20 enum nss_status _nss_nis_sethostent (int stayopen) +{ + return _nss_nis_endhostent (); +} + +enum nss_status +_nss_nis_endhostent (void) { __libc_lock_lock (lock); =20 @@ -108,11 +115,7 @@ _nss_nis_sethostent (int stayopen) =20 return NSS_STATUS_SUCCESS; } -/* Make _nss_nis_endhostent an alias of _nss_nis_sethostent. We do this - even though the prototypes don't match. The argument of sethostent - is used so this makes no difference. */ -strong_alias (_nss_nis_sethostent, _nss_nis_endhostent) - +hidden_def (_nss_nis_endhostent) =20 /* The calling function always need to get a lock first. */ static enum nss_status diff --git a/nis/nss_nis/nis-network.c b/nis/nss_nis/nis-network.c index dcafd26148..511de00bd3 100644 --- a/nis/nss_nis/nis-network.c +++ b/nis/nss_nis/nis-network.c @@ -45,10 +45,18 @@ static bool_t new_start =3D 1; static char *oldkey; static int oldkeylen; =20 +hidden_proto (_nss_nis_endnetent) + enum nss_status _nss_nis_setnetent (int stayopen) { - __libc_lock_lock (lock); + return _nss_nis_endnetent (); +} + +enum nss_status +_nss_nis_endnetent (void) +{ +__libc_lock_lock (lock); =20 new_start =3D 1; if (oldkey !=3D NULL) @@ -62,10 +70,7 @@ _nss_nis_setnetent (int stayopen) =20 return NSS_STATUS_SUCCESS; } -/* Make _nss_nis_endnetent an alias of _nss_nis_setnetent. We do this - even though the prototypes don't match. The argument of setnetent - is not used so this makes no difference. */ -strong_alias (_nss_nis_setnetent, _nss_nis_endnetent) +hidden_def (_nss_nis_endnetent) =20 static enum nss_status internal_nis_getnetent_r (struct netent *net, char *buffer, size_t buflen, diff --git a/nis/nss_nis/nis-spwd.c b/nis/nss_nis/nis-spwd.c index 6cd46b4022..660447b544 100644 --- a/nis/nss_nis/nis-spwd.c +++ b/nis/nss_nis/nis-spwd.c @@ -46,8 +46,16 @@ static bool ent_adjunct_used; static char *oldkey; static int oldkeylen; =20 +hidden_proto (_nss_nis_endspent) + enum nss_status _nss_nis_setspent (int stayopen) +{ + return _nss_nis_endspent (); +} + +enum nss_status +_nss_nis_endspent (void) { __libc_lock_lock (lock); =20 @@ -61,10 +69,7 @@ _nss_nis_setspent (int stayopen) =20 return NSS_STATUS_SUCCESS; } -/* Make _nss_nis_endspent an alias of _nss_nis_setspent. We do this - even though the prototypes don't match. The argument of setspent - is not used so this makes no difference. */ -strong_alias (_nss_nis_setspent, _nss_nis_endspent) +hidden_def (_nss_nis_endspent) =20 static enum nss_status internal_nis_getspent_r (struct spwd *sp, char *buffer, size_t buflen,