Blame SOURCES/nss-pam-ldapd-0.8.13-avoid-lockout-on-bad-password.patch

09a3f6
diff -up nss-pam-ldapd-0.8.13/nslcd/myldap.c.avoid_lockout_on_bad_password nss-pam-ldapd-0.8.13/nslcd/myldap.c
09a3f6
--- nss-pam-ldapd-0.8.13/nslcd/myldap.c.avoid_lockout_on_bad_password	2017-10-24 12:04:22.275105596 +0200
09a3f6
+++ nss-pam-ldapd-0.8.13/nslcd/myldap.c	2017-10-24 12:04:39.355175121 +0200
09a3f6
@@ -967,6 +967,13 @@ static int do_retry_search(MYLDAP_SEARCH
09a3f6
         /* try to start the search */
09a3f6
         pthread_mutex_unlock(&uris_mutex);
09a3f6
         rc=do_try_search(search);
09a3f6
+        /* if we are authenticating a user and get an error regarding failed
09a3f6
+           password we should error out instead of trying all servers */
09a3f6
+        if ((search->session->binddn[0] != '\0') && (rc == LDAP_INVALID_CREDENTIALS))
09a3f6
+        {
09a3f6
+          do_close(search->session);
09a3f6
+          return rc;
09a3f6
+        }
09a3f6
         if (rc==LDAP_SUCCESS)
09a3f6
         {
09a3f6
           pthread_mutex_lock(&uris_mutex);