[SSSD] [PATCH] Retry the next server if bind during LDAP auth times out

Jakub Hrozek jhrozek at redhat.com
Tue Sep 4 16:36:38 UTC 2012


In the very rare case, where the initial connection to the LDAP server
would succeed during authentication, but the bind would time out, then
the SSSD wouldn't retry the next server.
-------------- next part --------------
>From 06522c42705ad9c7de5532434be6e92dbff7197b Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Tue, 4 Sep 2012 17:47:04 +0200
Subject: [PATCH] Retry the next server if bind during LDAP auth times out

---
 src/providers/ldap/ldap_auth.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c
index da64f249ecc790fb76d33eb22e76e12ccb3fdc4c..cc5eff1b2d0cb693e1d869791b9d51cf633d1485 100644
--- a/src/providers/ldap/ldap_auth.c
+++ b/src/providers/ldap/ldap_auth.c
@@ -656,7 +656,12 @@ static void auth_bind_user_done(struct tevent_req *subreq)
         state->pw_expire_data = ppolicy;
     }
     talloc_zfree(subreq);
-    if (ret) {
+    if (ret == ETIMEDOUT) {
+        if (auth_get_server(req) == NULL) {
+            tevent_req_error(req, ENOMEM);
+        }
+        return;
+    } else if (ret != EOK) {
         tevent_req_error(req, ret);
         return;
     }
-- 
1.7.11.4



More information about the sssd-devel mailing list