lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1326 - nss-pam-ldapd/pam

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

nss-pam-ldapd commit: r1326 - nss-pam-ldapd/pam



Author: arthur
Date: Sun Dec 12 23:22:28 2010
New Revision: 1326
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1326

Log:
fallback to standard PAM error message if one wasn't returned by nslcd

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

Modified: nss-pam-ldapd/pam/pam.c
==============================================================================
--- nss-pam-ldapd/pam/pam.c     Sun Dec 12 23:15:15 2010        (r1325)
+++ nss-pam-ldapd/pam/pam.c     Sun Dec 12 23:22:28 2010        (r1326)
@@ -433,6 +433,9 @@
   /* check the returned authorisation value */
   if (ctx2.authz!=PAM_SUCCESS)
   {
+    /* turn in to generic PAM error message if message is empty */
+    if ((ctx2.authzmsg==NULL)||(ctx2.authzmsg[0]=='\0'))
+      ctx2.authzmsg=(char *)pam_strerror(pamh,ctx2.authz);
     pam_syslog(pamh,LOG_NOTICE,"%s; user=%s",ctx2.authzmsg,username);
     rc=remap_pam_rc(ctx2.authz,&cfg);
     if ((rc!=PAM_IGNORE)&&(!cfg.no_warn))
@@ -442,6 +445,8 @@
   /* check the original authorisation check from authentication */
   if (ctx->authz!=PAM_SUCCESS)
   {
+    if ((ctx->authzmsg==NULL)||(ctx->authzmsg[0]=='\0'))
+      ctx->authzmsg=(char *)pam_strerror(pamh,ctx->authz);
     pam_syslog(pamh,LOG_NOTICE,"%s; user=%s",ctx->authzmsg,username);
     rc=remap_pam_rc(ctx->authz,&cfg);
     if ((rc!=PAM_IGNORE)&&(!cfg.no_warn))
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits