Subject: Forcing all nsdispatch(3) methods to be invoked
To: None <tech-userlevel@NetBSD.org>
From: Luke Mewburn <lukem@NetBSD.org>
List: tech-userlevel
Date: 09/29/2004 01:26:44
--1gsfN/+pS0/2Ta7u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

I needed the following functionality in nsdispatch(3):

	Some invokers of nsdispatch() (such as setgrent(3)) need
	to force all methods to be invoked, irrespective of the
	action criteria listed in nsswitch.conf(5).  This can be
	achieved by adding NS_FORCEALL to defaults[0].flags before
	invoking nsdispatch().  The return value of nsdispatch()
	will be the result of the final call- back method invoked.

It was trivial to add and it shouldn't cause any backward
ABI or API compatibility issues.  Note that unlike the other
return values for nsdispatch(3)-invoked callbacks, NS_FORCEALL
does not have an equivalent parameter in nsswitch.conf(5), and
nor should it.

This functionality is necessary to correctly implement functions
such as setgrent(3), endgrent(3), setpwent(3), and endpwent(3)
when using with dynamic database back-ends, where the user has
listed multiple sources in nsswitch.conf for a given database.

Any comments?

--1gsfN/+pS0/2Ta7u
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQFBWYK0pBhtmn8zJHIRAlryAJwMnkEle5ATZ/cSvEXlInC/Rw3meQCbBcRu
m/r6FCvcG3HPgdVsno5xerI=
=oEm3
-----END PGP SIGNATURE-----

--1gsfN/+pS0/2Ta7u--