Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/lib/libpam/modules/pam_unix Pull up revision 1.9 (request...



details:   https://anonhg.NetBSD.org/src/rev/5e7bfffe25fd
branches:  netbsd-3
changeset: 576552:5e7bfffe25fd
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jul 11 11:30:07 2005 +0000

description:
Pull up revision 1.9 (requested by lukem in ticket #539):
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.

diffstat:

 lib/libpam/modules/pam_unix/pam_unix.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 71009487e10d -r 5e7bfffe25fd lib/libpam/modules/pam_unix/pam_unix.c
--- a/lib/libpam/modules/pam_unix/pam_unix.c    Mon Jul 11 11:29:04 2005 +0000
+++ b/lib/libpam/modules/pam_unix/pam_unix.c    Mon Jul 11 11:30:07 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_unix.c,v 1.5.2.3 2005/07/11 11:23:34 tron Exp $    */
+/*     $NetBSD: pam_unix.c,v 1.5.2.4 2005/07/11 11:30:07 tron Exp $    */
 
 /*-
  * Copyright 1998 Juniper Networks, Inc.
@@ -40,7 +40,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_unix/pam_unix.c,v 1.49 2004/02/10 10:13:21 des Exp $");
 #else
-__RCSID("$NetBSD: pam_unix.c,v 1.5.2.3 2005/07/11 11:23:34 tron Exp $");
+__RCSID("$NetBSD: pam_unix.c,v 1.5.2.4 2005/07/11 11:30:07 tron Exp $");
 #endif
 
 
@@ -90,6 +90,7 @@
        const char *pass, *user, *realpw;
        char pwbuf[1024];
 
+       pwd = NULL;
        if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF)) {
                (void) getpwnam_r(getlogin(), &pwres, pwbuf, sizeof(pwbuf),
                                  &pwd);
@@ -414,6 +415,7 @@
        int r;
 #endif
 
+       pwd = NULL;
        if (openpam_get_option(pamh, PAM_OPT_AUTH_AS_SELF))
                (void) getpwnam_r(getlogin(), &old_pwd, old_pwbuf,
                                  sizeof(old_pwbuf), &pwd);



Home | Main Index | Thread Index | Old Index