summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_unix/pam_unix_auth.c4
-rw-r--r--modules/pam_unix/support.c7
2 files changed, 7 insertions, 4 deletions
diff --git a/modules/pam_unix/pam_unix_auth.c b/modules/pam_unix/pam_unix_auth.c
index 23eba7e6..38e78152 100644
--- a/modules/pam_unix/pam_unix_auth.c
+++ b/modules/pam_unix/pam_unix_auth.c
@@ -207,8 +207,8 @@ PAM_EXTERN int pam_sm_setcred(pam_handle_t * pamh, int flags
D(("recovering return code from auth call"));
/* We will only find something here if UNIX_LIKE_AUTH is set --
don't worry about an explicit check of argv. */
- pam_get_data(pamh, "unix_setcred_return", &pretval);
- if(pretval) {
+ if (pam_get_data(pamh, "unix_setcred_return", &pretval) == PAM_SUCCESS
+ && pretval) {
retval = *(const int *)pretval;
pam_set_data(pamh, "unix_setcred_return", NULL, NULL);
D(("recovered data indicates that old retval was %d", retval));
diff --git a/modules/pam_unix/support.c b/modules/pam_unix/support.c
index f399189d..bb75298c 100644
--- a/modules/pam_unix/support.c
+++ b/modules/pam_unix/support.c
@@ -816,8 +816,11 @@ int _unix_verify_password(pam_handle_t * pamh, const char *name
new->name = x_strdup(login_name);
/* any previous failures for this user ? */
- pam_get_data(pamh, data_name, &void_old);
- old = void_old;
+ if (pam_get_data(pamh, data_name, &void_old)
+ == PAM_SUCCESS)
+ old = void_old;
+ else
+ old = NULL;
if (old != NULL) {
new->count = old->count + 1;