Subject: Re: getpw*_r standards
To: Klaus Klein <>
From: Luke Mewburn <>
List: current-users
Date: 04/19/2005 09:57:31
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Apr 19, 2005 at 01:36:15AM +0200, Klaus Klein wrote:
  | > AFAICT, Klaus & Nathan are recommending that getpwnam_r():
  | >     *	return 0 and set result to NULL for "notfound", and
  | >     *	return errno (!0) and set result to NULL for "error".
  | > If I have understood that correctly, we can change get{pw,gr}*_r()
  | > to do this.
  | That's correct as far as I'm concerned.
  | > 2.0's getpwnam() returns NULL in both the "not found" and "error"
  | > case, and in both cases errno is indeterminately set depending
  | > on what the back-end modules (files, nis, dns, ...) do.
  | > -current's getpwnam() has the same behaviour.
  | I tried my little experiment in a simple files back-end environment
  | only (I didn't have any other 2.0 setup at hand, but OTOH that
  | configuration is what one would expect to be as close as it can
  | still get to "traditional" behavior given code reuse in the
  | back-end). However, the spec applies the same way here: There
  | should be no "error" indication (as in touching errno) for
  | "notfound".


  | But given nsdispatch()'s callback return values it should be easy to
  | distinguish between that and "error", shouldn't it?



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

Version: GnuPG v1.4.1 (NetBSD)