OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.7 KiB

  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 - 2006 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>
  17. ##
  18. ## log failure of writing shadowLastChange to syslog
  19. --- ./pam_ldap.c
  20. +++ ./pam_ldap.c 2005-03-28 11:46:41.345626723 +0200
  21. @@ -3625,6 +3625,8 @@
  22. }
  23. else
  24. {
  25. + int errcode;
  26. +
  27. /* update shadowLastChange; may fail if not shadowAccount */
  28. snprintf (buf, sizeof buf, "%ld", time (NULL) / (60 * 60 * 24));
  29. strvals[0] = buf;
  30. @@ -3637,8 +3639,14 @@
  31. mods[0] = &mod;
  32. mods[1] = NULL;
  33. - /* do this silently because it may fail */
  34. - (void) ldap_modify_s (session->ld, session->info->userdn, mods);
  35. + /* Only log errors because it may fail */
  36. + errcode = ldap_modify_s (session->ld, session->info->userdn, mods);
  37. + if (errcode != LDAP_SUCCESS)
  38. + {
  39. + syslog (LOG_WARNING,
  40. + "pam_ldap: Unable to update shadowLastChange attribute: %s",
  41. + ldap_err2string (rc));
  42. + }
  43. snprintf (errmsg, sizeof errmsg,
  44. "LDAP password information changed for %s", username);