From patchwork Thu Feb 13 09:01:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1237348 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-109649-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha1 header.s=default header.b=OZWFeDt7; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=dFKwzfQq; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 48J9Vd61KFz9sP7 for ; Thu, 13 Feb 2020 20:01:45 +1100 (AEDT) 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=e5r0XkbzxWwqb5rp6Lxwu6dLOMpXr5PG2EPnMgPs1DV QsKUhWY2EoEp2rgYKpbdDMM7MRW83BRvR5BF2v+HVngy1PnjZnZdkZ9G9YitRyKr cGiSMjiSXKkIfvpU4GmgdcOLK3sjhbuyA8sCljSbvEFpCs2PDJPvZVdluOaLIlvk = 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=OZWFeDt7bGyGQqXEY SzICJVchgfrjQMa/AprXrWZoWuHyVUGjytLU6QbhpDf70i4mz35MZ8vm9MGjJ3+4 XbjZsJuEPwEvzA7rZ5L+4wmLKaHBy7xL02lCL3luiZK9fwk0UYOGxSzHEmJ47d7N nQgXFWSVojzu6yAJ0R+E6QMPFg= 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 Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 23835 invoked by uid 89); 13 Feb 2020 09:01:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= 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 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 @@ #include "nsswitch.h" +NSS_DECLARE_MODULE_FUNCTIONS (nis) /* 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 = 1; static char *oldkey = NULL; static int oldkeylen = 0; +hidden_proto (_nss_nis_endhostent) enum nss_status _nss_nis_sethostent (int stayopen) +{ + return _nss_nis_endhostent (); +} + +enum nss_status +_nss_nis_endhostent (void) { __libc_lock_lock (lock); @@ -108,11 +115,7 @@ _nss_nis_sethostent (int stayopen) 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) /* 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 = 1; static char *oldkey; static int oldkeylen; +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); new_start = 1; if (oldkey != NULL) @@ -62,10 +70,7 @@ _nss_nis_setnetent (int stayopen) 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) 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; +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); @@ -61,10 +69,7 @@ _nss_nis_setspent (int stayopen) 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) static enum nss_status internal_nis_getspent_r (struct spwd *sp, char *buffer, size_t buflen,