lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1449 - nss-pam-ldapd/nslcd

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

nss-pam-ldapd commit: r1449 - nss-pam-ldapd/nslcd



Author: arthur
Date: Sat Apr 30 23:26:41 2011
New Revision: 1449
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1449

Log:
close the nslcd connection to signal LDAP server unavailable to PAM module

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

Modified: nss-pam-ldapd/nslcd/pam.c
==============================================================================
--- nss-pam-ldapd/nslcd/pam.c   Sat Apr 30 23:01:51 2011        (r1448)
+++ nss-pam-ldapd/nslcd/pam.c   Sat Apr 30 23:26:41 2011        (r1449)
@@ -277,16 +277,10 @@
     if (entry==NULL)
     {
       /* for user not found we just say no result */
-      if (rc!=LDAP_NO_SUCH_OBJECT)
+      if (rc==LDAP_NO_SUCH_OBJECT)
       {
-        WRITE_INT32(fp,NSLCD_RESULT_BEGIN);
-        WRITE_STRING(fp,username);
-        WRITE_STRING(fp,"");
-        WRITE_INT32(fp,NSLCD_PAM_AUTHINFO_UNAVAIL); /* authc */
-        WRITE_INT32(fp,NSLCD_PAM_SUCCESS);          /* authz */
-        WRITE_STRING(fp,"LDAP server unavaiable");  /* authzmsg */
+        WRITE_INT32(fp,NSLCD_RESULT_END);
       }
-      WRITE_INT32(fp,NSLCD_RESULT_END);
       return -1;
     }
     userdn=myldap_get_dn(entry);
@@ -464,16 +458,10 @@
   if (entry==NULL)
   {
     /* for user not found we just say no result */
-    if (rc!=LDAP_NO_SUCH_OBJECT)
+    if (rc==LDAP_NO_SUCH_OBJECT)
     {
-      WRITE_INT32(fp,NSLCD_RESULT_BEGIN);
-      WRITE_STRING(fp,username);
-      WRITE_STRING(fp,"");
-      WRITE_INT32(fp,NSLCD_PAM_PERM_DENIED);
-      WRITE_STRING(fp,ldap_err2string(rc));
       WRITE_INT32(fp,NSLCD_RESULT_END);
     }
-    WRITE_INT32(fp,NSLCD_RESULT_END);
     return -1;
   }
   /* check authorisation search */
@@ -625,7 +613,11 @@
   entry=validate_user(session,username,&rc);
   if (entry==NULL)
   {
-    WRITE_INT32(fp,NSLCD_RESULT_END);
+    /* for user not found we just say no result */
+    if (rc==LDAP_NO_SUCH_OBJECT)
+    {
+      WRITE_INT32(fp,NSLCD_RESULT_END);
+    }
     return -1;
   }
   /* check if the the user passed the rootpwmoddn */
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits