From 057f97683708a55269cc57394edac8a657c8eaff Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Tue, 23 Nov 2004 12:53:19 +0000 Subject: Relevant BUGIDs: Red Hat bz 140451 Purpose of commit: bugfix Commit summary: --------------- Convert uid gid from passwd entry always as decimal. Test failure. --- modules/pam_unix/pam_unix_passwd.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/pam_unix/pam_unix_passwd.c') diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c index 816668f5..2ea57cc6 100644 --- a/modules/pam_unix/pam_unix_passwd.c +++ b/modules/pam_unix/pam_unix_passwd.c @@ -813,6 +813,12 @@ PAM_EXTERN int pam_sm_chauthtok(pam_handle_t * pamh, int flags, } else { struct passwd *pwd; _unix_getpwnam(pamh, user, 1, 1, &pwd); + if (pwd == NULL) { + _log_err(LOG_DEBUG, pamh, + "user \"%s\" has corrupted passwd entry", + user); + return PAM_USER_UNKNOWN; + } if (!_unix_shadowed(pwd) && (strchr(pwd->pw_passwd, '*') != NULL)) { _log_err(LOG_DEBUG, pamh, -- cgit v1.2.3