Subject: Re: NSS
To: Hubert Feyrer <>
From: Luke Mewburn <>
List: tech-userlevel
Date: 07/04/2005 09:27:45
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 modules,
  | >at least for "passwd" and "group"; I've ported samba's
  | > to this.
  | Is that 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).
  | Can you tell a few pointers for what to look at for writing ones own ns=
  | module? How would one start converting the missing functions?
  | Having some documentation on "writing your own nss module" would be nic=
  | 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
	for a given database.
	E.g., passwd wants:
		setpassent, setpwent, endpwent, getpwent, getpwent_r,
		getpwnam, getpwnam_r, getpwuid, getpwuid_r,


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

Version: GnuPG v1.4.1 (NetBSD)