From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id 20DD13858C54 for ; Wed, 15 Jun 2022 07:03:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 20DD13858C54 Received: by mail-qv1-xf30.google.com with SMTP id v12so1509008qvh.9 for ; Wed, 15 Jun 2022 00:03:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3wbksephvteqGUflQxSrYfE+e7oTGqx1KMp4RgcNQeE=; b=JAsNDBzwGpbL9iV31WFG5aJFR0cpOlkNM7M/Ic2jtsKr2/FI19NXC2G9HFUEI+7jqU +b+aL4pScmaLr504CxnDgxgzRj7RcPcxjazr66AlzUiWtGX1wUzPrFCLTIY5NUnMoDty sl1lSXpk15QnyLV3KjIIDyjB0/JSj9hN/k62mWx9Bs+pRMcF2SE6yW4xV70/YG3ZVjSu 1lKMreHaLsOOsrrCvOJ2ZKulZvsQmm1d0vQM+mqGtK8p0bmcsELZK1cV43lTB12r0cC2 uUKcNE9m+mFWdH+zQf1pT4rshDdZx6XCySZiG3vce3XMZMXj+yK4K9SjNXl1C+oT4Eu5 bEQg== X-Gm-Message-State: AJIora8jeX5mHKH6Qo1B+mKkXoTOLTQpB7GJD2m+puXSN5PQCV7lCKuG EHxnPx+8ik01YMOl7UBFG/ahQ5P9phtNWNOtSJw= X-Google-Smtp-Source: AGRyM1v2lb/h0FRR0SbD3B7r7ZsgoltWPqBF1+LCKl4TnGKUe+JRpdCpzUNOh4eP1nryX782sc1ETQUCZXpS5modP5g= X-Received: by 2002:a05:6214:5195:b0:464:507d:8eea with SMTP id kl21-20020a056214519500b00464507d8eeamr6901457qvb.91.1655276618378; Wed, 15 Jun 2022 00:03:38 -0700 (PDT) MIME-Version: 1.0 References: <87r13qqxs7.fsf@oldenburg.str.redhat.com> In-Reply-To: <87r13qqxs7.fsf@oldenburg.str.redhat.com> From: Pranjal Goswami Date: Wed, 15 Jun 2022 12:33:27 +0530 Message-ID: Subject: Re: Need help with adding a new service to nsswitch.conf To: Florian Weimer Cc: Pranjal Goswami via Libc-help X-Spam-Status: No, score=-0.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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 07:03:49 -0000 I see. So we have an option of building my own NSS module outside the glibc build system , referencing and using NSS_DECLARE_MODULE_FUNCTIONS (secmgr) to get to the declarations for the plug-in functions. So it means that for writing a new module, we need and NSS_DECLARE_MODULE_FUNCTIONS (secmgr) only. There are no other changes to be done within the nss folder ? Regards Pranjal On Wed, Jun 15, 2022 at 11:21 AM Florian Weimer wrote: > * 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 > >