From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 9A016385740B for ; Wed, 15 Jun 2022 05:51:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9A016385740B 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-441-D6oM8LEsNOSFsSwX-jHl7w-1; Wed, 15 Jun 2022 01:51:55 -0400 X-MC-Unique: D6oM8LEsNOSFsSwX-jHl7w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CF9A280B90D; Wed, 15 Jun 2022 05:51:54 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.90]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 040A52026D64; Wed, 15 Jun 2022 05:51:53 +0000 (UTC) From: Florian Weimer To: Pranjal Goswami via Libc-help Cc: Pranjal Goswami Subject: Re: Need help with adding a new service to nsswitch.conf References: Date: Wed, 15 Jun 2022 07:51:52 +0200 In-Reply-To: (Pranjal Goswami via Libc-help's message of "Tue, 14 Jun 2022 20:26:14 +0530") Message-ID: <87r13qqxs7.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2022 05:52:00 -0000 * Pranjal Goswami via Libc-help: > Hi Friends , > I am looking at adding another service in nsswitch.conf which can look for > user presence in a file other than /etc/password. I have copied the files > from nss_files to a new folder and I have made the changes in the > Makefile under nss to get my module to build.. However I get an error when > I try to build glibc. > /../include/libc-symbols.h:34:32: warning: "MODULE_libnss_secmgr" is not > defined, evaluates to 0 [-Wundef] > 34 | #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME) > | ^~~~~~~ > ./../include/libc-symbols.h:32:26: note: in definition of macro > 'PASTE_NAME1' > 32 | #define PASTE_NAME1(a,b) a##b > | ^ > ./../include/libc-symbols.h:34:20: note: in expansion of macro 'PASTE_NAME' > 34 | #define IN_MODULE PASTE_NAME (MODULE_, MODULE_NAME) > > secmgr is the module that I am adding. I suspect that the problem is > related to the line NSS_DECLARE_MODULE_FUNCTIONS (secmgr). > So if we are adding a new service under nss , what additional things we > need to do besides adding a module under nss and having teh same set of > files as in nss/files - renamed to the new service that that am using? Is there a reason why you need to build your NSS module under the glibc build system? is an installed header file, and you can use NSS_DECLARE_MODULE_FUNCTIONS (secmgr) to get declarations for all the recognized plug-in functions. Thanks, Florian