Subject: Re: CVS commit: src/lib/libpam/modules/pam_unix
To: John Nemeth <jnemeth@victoria.tc.ca>
From: Luke Mewburn <lukem@NetBSD.org>
List: current-users
Date: 04/19/2005 14:18:21
--agiWCrAZ2JOwsdBK
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Mon, Apr 18, 2005 at 09:10:48PM -0700, John Nemeth wrote:
| On Aug 4, 3:47pm, Luke Mewburn wrote:
| }=20
| } Module Name: src
| } Committed By: lukem
| } Date: Tue Apr 19 03:40:16 UTC 2005
| }=20
| } Modified Files:
| } src/lib/libpam/modules/pam_unix: pam_unix.c
| }=20
| } Log Message:
| } Safety boots: don't depend upon getpwnam_r() to set pwd to NULL on all
| } failures, especially if we're going to ignore the return result.
|=20
| Umm, I thought the result of the discussion was that POSIX
| mandates that pwd be set to NULL for all errors AND when the entry
| isn't found. Thus if pwd isn't set to NULL for some failure case then
| getpwnam_r is very broken.
True, it is very broken. However, if we're going to ignore the return
result of a function yet check a pointer we've passed to it against
NULL later on, it doesn't hurt to ensure that we assign the pointer
to a known NULL value before invocation. That's the "safety boots"
reference.
--agiWCrAZ2JOwsdBK
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (NetBSD)
iD8DBQFCZIaNpBhtmn8zJHIRAr2wAKCzwSDWqUfw/6ACqx8B0GigMMJ0vACeL+kR
iUDTFUYqNhug6mPBHuCt0lk=
=C+cY
-----END PGP SIGNATURE-----
--agiWCrAZ2JOwsdBK--