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: 1780132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=dwWRTyk2; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QHFh63R6rz213w for ; Fri, 12 May 2023 01:10:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8BBF23858431 for ; Thu, 11 May 2023 15:10:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BBF23858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683817827; bh=i0DtcVuw1p6HTeOBRCjrCvSXcYaiZSMy47EunA2g1N8=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=dwWRTyk28hRTB9YLxTEeVN7IvaXJ1xEd/0d1XZsyBzW6bJfx/RIkJezmwTtHAjLWq 1WEahHQpimffRhNAgA5LexkG/QNx9CXewjjZvP+PAmlSRHwIi/ZA5ETWnL0c5PWyPT SykAkr4pVAzscPxjKNjulWAsonQCyzPorbu/joPE= 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+incoming=patchwork.ozlabs.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. */