lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1899 - nss-pam-ldapd/pam

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1899 - nss-pam-ldapd/pam



Author: arthur
Date: Sat Jan  5 23:49:39 2013
New Revision: 1899
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1899&view=revision

Log:
save the old password if either the authentication or the authorisation 
response is NEW_AUTHTOK_REQD

Modified:
   nss-pam-ldapd/pam/pam.c

Modified: nss-pam-ldapd/pam/pam.c
==============================================================================
--- nss-pam-ldapd/pam/pam.c     Sat Jan  5 17:31:29 2013        (r1898)
+++ nss-pam-ldapd/pam/pam.c     Sat Jan  5 23:49:39 2013        (r1899)
@@ -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 @@
   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))
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/