From owner-freebsd-hackers Tue Aug 3 23:10:58 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from iclub.nsu.ru (iclub.nsu.ru [193.124.222.66]) by hub.freebsd.org (Postfix) with ESMTP id BD2441530E for ; Tue, 3 Aug 1999 23:10:50 -0700 (PDT) (envelope-from fjoe@iclub.nsu.ru) Received: from localhost (fjoe@localhost) by iclub.nsu.ru (8.9.3/8.9.3) with ESMTP id NAA12471; Wed, 4 Aug 1999 13:08:44 +0700 (NSS) (envelope-from fjoe@iclub.nsu.ru) Date: Wed, 4 Aug 1999 13:08:43 +0700 (NSS) From: Max Khon To: Oscar Bonilla Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: NSS Project In-Reply-To: <19990803095333.A14120@fisicc-ufm.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG hi, there! On Tue, 3 Aug 1999, Oscar Bonilla wrote: > *Step One: I ported the NetBSD implementation of nsdispatch(3) as implemented > by Luke Mewburn. See attached patch to libc and new header file. I'm also > attaching the man page for /etc/nsswitch.conf. Right now it compiles, > installs, and works for some simple tests I've run. > > *Step Two: make getpwent, getgrent, and friends actually use the nsdispatch > function. I've already started looking at the source, but am having trouble > with the NIS part. Maybe someone more knowledgeable could write the NIS > function. > > Basically we have to reduce each of the functions to a simple nsdispatch > call and then implement the real functions... Here's an example from > getpwent.c > > /* Basically we reduce getpwent to a simple nsdispatch call */ > > struct passwd * > getpwent() > { > int r; > static const ns_dtab dtab[] = { > NS_FILES_CB(_local_getpw, NULL) > NS_DNS_CB(_dns_getpw, NULL) > NS_NIS_CB(_nis_getpw, NULL) > NS_COMPAT_CB(_compat_getpwent, NULL) > { 0 } > }; > > r = nsdispatch(NULL, dtab, NSDB_PASSWD, "getpwent", compatsrc, > _PW_KEYBYNUM); > if (r != NS_SUCCESS) > return (struct passwd *)NULL; > return &_pw_passwd; > } > > The we have to implement _local_getpw, _dns_getpw, _nis_getpw, > and _compat_getpwent and make them behave as expected. > NetBSD seems to support having the passwd database on DNS using something > called HESIOD (I hadn't heard about it before). I don't think FreeBSD > *Step Three: Implement _ldap_getpw :) pam/nss ldap modules are already available (http://www.padl.com) i think we should implement NSS in that way so we need not recompile if we want to add third-party nss module. Also compatibility with Solaris is desirable. /fjoe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message