Subject: Re: NSS
To: Hubert Feyrer <hubert@feyrer.de>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-userlevel
Date: 07/04/2005 09:27:45
--ieNMXl1Fr3cevapt
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Jul 04, 2005 at 01:08:31AM +0200, Hubert Feyrer wrote:
  | On Mon, 4 Jul 2005, Luke Mewburn wrote:
  | >The internal nsswitch "API" used by various functions (such as
  | >getpwent(3), getgrent(3)) has been made more consistent, although
  | >I only recently requested pullups to netbsd-3 for these.
  | >This makes it easier to write dynamic nss_foo.so modules,
  | >at least for "passwd" and "group"; I've ported samba's
  | >nss_winbind.so to this.
  |=20
  | Is that nss_winbind.so available somewhere (in source)?

I first need to port it from samba 3.0.10 to samba 3.0.20(?)
and then test it.  The former isn't that hard, but I need
to update my samba test environment in VMware before I can
do the latter.


  | >The documentation on the new (internal) API convention is still
  | >a bit lacking -- I hope to eventually rectify this.
  | >Note: Not all "standard" getXXbyYYY functions have been converted
  | >to the internal API; until that's done not all databases in
  | >nsswitch.conf(5) can have dynamic backends (without ugly hacks).
  |=20
  | Can you tell a few pointers for what to look at for writing ones own ns=
s=20
  | module? How would one start converting the missing functions?
  | Having some documentation on "writing your own nss module" would be nic=
e,=20
  | even if the backend is really simple (plain ascii? :)

Check the mailing list archives; I posted some comments about it.
Check how I modified lib/libc/gen/getusershell.c for the new convention
used by "public" functions that are implemented on top of nsdispatch(3).

I intend to provide documention on:

    1.	How the nsdispatch(3) calling convention is used.

    2.	Which functions should be implemented in nss_foo.so
	for a given database.
	E.g., passwd wants:
		setpassent, setpwent, endpwent, getpwent, getpwent_r,
		getpwnam, getpwnam_r, getpwuid, getpwuid_r,


Cheers,
Luke.

--ieNMXl1Fr3cevapt
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)

iD8DBQFCyHRxpBhtmn8zJHIRAukOAJ4vphNtLMJl/W06UIAbDVkaRlVdogCgnfKq
WPxUZq0lBNkscOWYYjhnzcg=
=I6gp
-----END PGP SIGNATURE-----

--ieNMXl1Fr3cevapt--