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_ssh Pull up revision 1.11 (request...



details:   https://anonhg.NetBSD.org/src/rev/f4c1a1aac7c5
branches:  netbsd-3
changeset: 576547:f4c1a1aac7c5
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jul 11 11:19:26 2005 +0000

description:
Pull up revision 1.11 (requested by lukem in ticket #539):
check for pwd != in getpw*_r functions.

diffstat:

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

diffs (38 lines):

diff -r 1588cd294c15 -r f4c1a1aac7c5 lib/libpam/modules/pam_ssh/pam_ssh.c
--- a/lib/libpam/modules/pam_ssh/pam_ssh.c      Mon Jul 11 11:18:33 2005 +0000
+++ b/lib/libpam/modules/pam_ssh/pam_ssh.c      Mon Jul 11 11:19:26 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_ssh.c,v 1.8.2.2 2005/04/04 17:55:13 tron Exp $     */
+/*     $NetBSD: pam_ssh.c,v 1.8.2.3 2005/07/11 11:19:26 tron Exp $     */
 
 /*-
  * Copyright (c) 2003 Networks Associates Technology, Inc.
@@ -38,7 +38,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_ssh/pam_ssh.c,v 1.40 2004/02/10 10:13:21 des Exp $");
 #else
-__RCSID("$NetBSD: pam_ssh.c,v 1.8.2.2 2005/04/04 17:55:13 tron Exp $");
+__RCSID("$NetBSD: pam_ssh.c,v 1.8.2.3 2005/07/11 11:19:26 tron Exp $");
 #endif
 
 #include <sys/param.h>
@@ -153,7 +153,8 @@
        pam_err = pam_get_user(pamh, &user, NULL);
        if (pam_err != PAM_SUCCESS)
                return (pam_err);
-       if (getpwnam_r(user, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0)
+       if (getpwnam_r(user, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0 ||
+           pwd == NULL)
                return (PAM_USER_UNKNOWN);
        if (pwd->pw_dir == NULL)
                return (PAM_AUTH_ERR);
@@ -414,7 +415,8 @@
        pam_err = pam_get_user(pamh, &user, NULL);
        if (pam_err != PAM_SUCCESS)
                return (pam_err);
-       if (getpwnam_r(user, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0)
+       if (getpwnam_r(user, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0 ||
+           pwd == NULL)
                return (PAM_USER_UNKNOWN);
 
        /* start the agent */



Home | Main Index | Thread Index | Old Index