diff options
| author | christos <christos@NetBSD.org> | 2005-04-19 03:15:34 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2005-04-19 03:15:34 +0000 |
| commit | 2a62e4e1adf2bbce8892ea76bdc1ba4d0103e8ab (patch) | |
| tree | 6a10b58ad30902fd51bbd98d8d57f8b9cb74f940 /lib/libpam/modules/pam_securetty | |
| parent | d0388cff8b393e8b35202d027307a785afa73774 (diff) | |
check for pwd != in getpw*_r functions.
Diffstat (limited to 'lib/libpam/modules/pam_securetty')
| -rw-r--r-- | lib/libpam/modules/pam_securetty/pam_securetty.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libpam/modules/pam_securetty/pam_securetty.c b/lib/libpam/modules/pam_securetty/pam_securetty.c index 38c09014888..b052ba0d49a 100644 --- a/lib/libpam/modules/pam_securetty/pam_securetty.c +++ b/lib/libpam/modules/pam_securetty/pam_securetty.c @@ -1,4 +1,4 @@ -/* $NetBSD: pam_securetty.c,v 1.3 2005/03/31 15:11:54 thorpej Exp $ */ +/* $NetBSD: pam_securetty.c,v 1.4 2005/04/19 03:15:36 christos Exp $ */ /*- * Copyright (c) 2001 Mark R V Murray @@ -40,7 +40,7 @@ #ifdef __FreeBSD__ __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_securetty/pam_securetty.c,v 1.13 2004/02/10 10:13:21 des Exp $"); #else -__RCSID("$NetBSD: pam_securetty.c,v 1.3 2005/03/31 15:11:54 thorpej Exp $"); +__RCSID("$NetBSD: pam_securetty.c,v 1.4 2005/04/19 03:15:36 christos Exp $"); #endif #include <sys/types.h> @@ -72,7 +72,8 @@ pam_sm_acct_mgmt(pam_handle_t *pamh __unused, int flags __unused, if (pam_err != PAM_SUCCESS) return (pam_err); if (user == NULL || - getpwnam_r(user, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0) + getpwnam_r(user, &pwres, pwbuf, sizeof(pwbuf), &pwd) != 0 || + pwd == NULL) return (PAM_SERVICE_ERR); PAM_LOG("Got user: %s", user); |
