summaryrefslogtreecommitdiff
path: root/modules/pam_mail
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2006-05-22 17:27:54 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2006-05-22 17:27:54 +0000
commit9251be9693b1c8c56ed067438858e740cba57570 (patch)
tree17fe57914bae9c80901e3288831a14f43524b539 /modules/pam_mail
parent747fce30ecb18b776fd91aefdcf3ab3508b42fbf (diff)
Relevant BUGIDs: 1490956,1489818,1489808,1489792,1489804,1489658,1489634
Purpose of commit: bugfixes Commit summary: --------------- 2006-05-22 Thorsten Kukuk <kukuk@thkukuk.de> * modules/pam_listfile/pam_listfile.c (pam_sm_authenticate): Fix memory leaks, [#1490956] found by Coverity. * modules/pam_tally/pam_tally.c (pam_get_uid): Check return value of pam_get_user(). (tally_get_data): Check if oldtime is not NULL. [#1489818] found by Coverity. * modules/pam_mkhomedir/pam_mkhomedir.c (create_homedir): Don't ignore return value of stat(). [#1489808] found by Coverity. * modules/pam_mail/pam_mail.c (get_folder): Fix a potential NULL pointer dereference. [#1489792] found by Coverity. * libpam/Makefile.am: bump release number of libpam.so. * libpam/pam_misc.c (_pam_mkargv): Fix memory leak, [#1489804] found by Coverity. * modules/pam_echo/pam_echo.c (replace_and_print): Initialize str, [#1489658] found by Coverity. * modules/pam_cracklib/pam_cracklib.c (_pam_unix_approve_pass): Fix a potential NULL pointer dereference. (pam_sm_chauthtok): Remove dead code. [#1489634] found by Coverity.
Diffstat (limited to 'modules/pam_mail')
-rw-r--r--modules/pam_mail/pam_mail.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/modules/pam_mail/pam_mail.c b/modules/pam_mail/pam_mail.c
index 5eb3488b..7d43d5e0 100644
--- a/modules/pam_mail/pam_mail.c
+++ b/modules/pam_mail/pam_mail.c
@@ -1,8 +1,6 @@
/* pam_mail module */
/*
- * $Id$
- *
* Written by Andrew Morgan <morgan@linux.kernel.org> 1996/3/11
* $HOME additions by David Kinchlea <kinch@kinch.ark.com> 1997/1/7
* mailhash additions by Chris Adams <cadams@ro.com> 1998/7/11
@@ -174,6 +172,14 @@ get_folder(pam_handle_t *pamh, int ctrl,
retval = PAM_BUF_ERR;
if (ctrl & PAM_HOME_MAIL) {
+ if (pwd == NULL) {
+ pwd = pam_modutil_getpwnam(pamh, user);
+ if (pwd == NULL) {
+ pam_syslog(pamh, LOG_ERR, "user unknown");
+ retval = PAM_USER_UNKNOWN;
+ goto get_folder_cleanup;
+ }
+ }
if (asprintf(&folder, MAIL_FILE_FORMAT, pwd->pw_dir, "", path) < 0)
goto get_folder_cleanup;
} else {