* updated krdc (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / package / network / pam_ldap / pam_ldap-178-shadowlastChange.patch
blob5561c9884a61d2f389c91cef1083dc1e9cddc813
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
3 #
4 # T2 SDE: package/.../pam_ldap/pam_ldap-178-shadowlastChange.patch
5 # Copyright (C) 2004 - 2007 The T2 SDE Project
6 #
7 # More information can be found in the files COPYING and README.
8 #
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
14 # version.
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
20 --- ./pam_ldap.c
21 +++ ./pam_ldap.c 2005-03-28 11:46:41.345626723 +0200
22 @@ -3625,6 +3625,8 @@
24 else
26 + int errcode;
28 /* update shadowLastChange; may fail if not shadowAccount */
29 snprintf (buf, sizeof buf, "%ld", time (NULL) / (60 * 60 * 24));
30 strvals[0] = buf;
31 @@ -3637,8 +3639,14 @@
32 mods[0] = &mod;
33 mods[1] = NULL;
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)
40 + {
41 + syslog (LOG_WARNING,
42 + "pam_ldap: Unable to update shadowLastChange attribute: %s",
43 + ldap_err2string (rc));
44 + }
46 snprintf (errmsg, sizeof errmsg,
47 "LDAP password information changed for %s", username);