1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../pam_ldap/pam_ldap-178-shadowlastChange.patch
5 # Copyright (C) 2004 - 2007 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
16 ## pam_ldap-178-shadowlastChange.patch by Peter Marschall <peter@adpm.de>
18 ## log failure of writing shadowLastChange to syslog
21 +++ ./pam_ldap.c 2005-03-28 11:46:41.345626723 +0200
28 /* update shadowLastChange; may fail if not shadowAccount */
29 snprintf (buf, sizeof buf, "%ld", time (NULL) / (60 * 60 * 24));
31 @@ -3637,8 +3639,14 @@
35 - /* do this silently because it may fail */
36 - (void) ldap_modify_s (session->ld, session->info->userdn, mods);
37 + /* Only log errors because it may fail */
38 + errcode = ldap_modify_s (session->ld, session->info->userdn, mods);
39 + if (errcode != LDAP_SUCCESS)
41 + syslog (LOG_WARNING,
42 + "pam_ldap: Unable to update shadowLastChange attribute: %s",
43 + ldap_err2string (rc));
46 snprintf (errmsg, sizeof errmsg,
47 "LDAP password information changed for %s", username);