From patchwork Thu May 11 15:09:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arjun Shankar X-Patchwork-Id: 69166 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DB7D33857027 for ; Thu, 11 May 2023 15:10:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB7D33857027 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683817834; bh=i0DtcVuw1p6HTeOBRCjrCvSXcYaiZSMy47EunA2g1N8=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=NO4mzbtKQZZjSWiJwDeNxFd9hJ6VDwZP0RqJqQRrYWvAdVPEn4+Rv68R49TI4F42y gw6wckc7nhlLn9YX1l1dznb1RPUEJUFY2ET247uQkT3FJz5FLnUhlziXxib+fIeL/8 zZmDfvTC9//yQ7JtdMBFjA6m994bARlrG9Z+maS0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org 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 277353856948 for ; Thu, 11 May 2023 15:09:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 277353856948 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-189-dzcTdD2YPJ6Lhwxf-c1x2g-1; Thu, 11 May 2023 11:09:56 -0400 X-MC-Unique: dzcTdD2YPJ6Lhwxf-c1x2g-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 096B588B774 for ; Thu, 11 May 2023 15:09:56 +0000 (UTC) Received: from x1carbon.redhat.com (unknown [10.45.226.202]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 319E42166B26; Thu, 11 May 2023 15:09:54 +0000 (UTC) To: libc-alpha@sourceware.org Cc: Arjun Shankar Subject: [PATCH] nss: Reconcile conditional declaration and use of `is_nscd' Date: Thu, 11 May 2023 17:09:30 +0200 Message-Id: <20230511150930.2026524-1-arjun@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_NONE, 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 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: , X-Patchwork-Original-From: Arjun Shankar via Libc-alpha From: Arjun Shankar Reply-To: Arjun Shankar Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" This change harmonizes the declaration and use of `is_nscd' and fixes a build failure with the "--enable-static-nss --enable-nscd" configuration options due to `is_nscd' being used undeclared. The purpose of `is_nscd' is to avoid (nss <-> nscd) recursion in dynamically linked libc (SHARED) that is nscd-aware (USE_NSCD), and so its declaration and use should be guarded by the definition of those macros. Reviewed-by: Carlos O'Donell --- nss/nss_module.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nss/nss_module.c b/nss/nss_module.c index 487e513def..0104f88974 100644 --- a/nss/nss_module.c +++ b/nss/nss_module.c @@ -53,7 +53,7 @@ static struct nss_module *nss_module_list; modules. */ __libc_lock_define (static, nss_module_list_lock); -#if defined USE_NSCD && (!defined DO_STATIC_NSS || defined SHARED) +#if defined SHARED && defined USE_NSCD /* Nonzero if this is the nscd process. */ static bool is_nscd; /* The callback passed to the init functions when nscd is used. */ @@ -147,7 +147,7 @@ module_load_builtin (struct nss_module *module, static bool module_load_nss_files (struct nss_module *module) { -#ifdef USE_NSCD +#if defined SHARED && defined USE_NSCD if (is_nscd) { void (*cb) (size_t, struct traced_file *) = nscd_init_cb; @@ -238,7 +238,7 @@ module_load (struct nss_module *module) PTR_MANGLE (pointers[idx]); } -# ifdef USE_NSCD +# if defined SHARED && defined USE_NSCD if (is_nscd) { /* Call the init function when nscd is used. */