Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/pam/pam.c
diff options
context:
space:
mode:
Diffstat (limited to 'pam/pam.c')
-rw-r--r--pam/pam.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pam/pam.c b/pam/pam.c
index 32cd98b..9947d52 100644
--- a/pam/pam.c
+++ b/pam/pam.c
@@ -2,7 +2,7 @@
pam.c - pam module functions
Copyright (C) 2009 Howard Chu
- Copyright (C) 2009, 2010, 2011, 2012 Arthur de Jong
+ Copyright (C) 2009, 2010, 2011, 2012, 2013 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -503,7 +503,7 @@ int pam_sm_authenticate(pam_handle_t *pamh, int flags,
if (cfg.debug)
pam_syslog(pamh, LOG_DEBUG, "authentication succeeded");
/* if password change is required, save old password in context */
- if (resp.res == PAM_NEW_AUTHTOK_REQD)
+ if ((resp.res == PAM_NEW_AUTHTOK_REQD) || (ctx->saved_authz.res == PAM_NEW_AUTHTOK_REQD))
ctx->oldpassword = strdup(passwd);
/* update caller's idea of the user name */
if ((resp.msg[0] != '\0') && (strcmp(resp.msg, username) != 0))