diff options
author | Steve Langasek <vorlon@debian.org> | 2019-02-11 22:09:25 -0800 |
---|---|---|
committer | Steve Langasek <vorlon@debian.org> | 2019-02-11 22:09:59 -0800 |
commit | 1a2cb1c4f6c710630ebe46a728bb8b8fb5f68946 (patch) | |
tree | ba50a9673cb6324c5dfcbdad3f5144588772fbfe /modules/pam_unix/pam_unix_auth.c | |
parent | b12d7595dfcc20c809f3c11c579e34d115b3060e (diff) | |
parent | 668b13da8f830c38388cecac45539972e80cb246 (diff) | |
download | pam-1a2cb1c4f6c710630ebe46a728bb8b8fb5f68946.tar.gz pam-1a2cb1c4f6c710630ebe46a728bb8b8fb5f68946.tar.bz2 pam-1a2cb1c4f6c710630ebe46a728bb8b8fb5f68946.zip |
Merge upstream version 1.3.1
Diffstat (limited to 'modules/pam_unix/pam_unix_auth.c')
-rw-r--r-- | modules/pam_unix/pam_unix_auth.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/modules/pam_unix/pam_unix_auth.c b/modules/pam_unix/pam_unix_auth.c index 673861e4..fce6bce1 100644 --- a/modules/pam_unix/pam_unix_auth.c +++ b/modules/pam_unix/pam_unix_auth.c @@ -77,14 +77,12 @@ #define _UNIX_AUTHTOK "-UN*X-PASS" #define AUTH_RETURN \ -do { \ - if (ret_data) { \ - D(("recording return code for next time [%d]", \ - retval)); \ - *ret_data = retval; \ - pam_set_data(pamh, "unix_setcred_return", \ - (void *) ret_data, setcred_free); \ - } \ +do { \ + D(("recording return code for next time [%d]", \ + retval)); \ + *ret_data = retval; \ + pam_set_data(pamh, "unix_setcred_return", \ + (void *) ret_data, setcred_free); \ D(("done. [%s]", pam_strerror(pamh, retval))); \ return retval; \ } while (0) @@ -112,6 +110,12 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) /* Get a few bytes so we can pass our return value to pam_sm_setcred() and pam_sm_acct_mgmt(). */ ret_data = malloc(sizeof(int)); + if (!ret_data) { + D(("cannot malloc ret_data")); + pam_syslog(pamh, LOG_CRIT, + "pam_unix_auth: cannot allocate ret_data"); + return PAM_BUF_ERR; + } /* get the user'name' */ |