|
|
2fc102 |
From 97616c8e1ab41c72c509a31626fafcfb07241a46 Mon Sep 17 00:00:00 2001
|
|
|
2fc102 |
From: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
2fc102 |
Date: Tue, 11 Feb 2014 12:23:51 +0100
|
|
|
2fc102 |
Subject: [PATCH 84/84] LDAP: Handle errors from sdap_id_op properly in enum
|
|
|
2fc102 |
code
|
|
|
2fc102 |
MIME-Version: 1.0
|
|
|
2fc102 |
Content-Type: text/plain; charset=UTF-8
|
|
|
2fc102 |
Content-Transfer-Encoding: 8bit
|
|
|
2fc102 |
|
|
|
2fc102 |
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
|
|
|
2fc102 |
(cherry picked from commit 93dabb2fe0a798f22bb802b9c6521ab9e6a4ac36)
|
|
|
2fc102 |
---
|
|
|
2fc102 |
src/providers/ldap/sdap_async_enum.c | 42 +++++++++++++++++++++++++++++++++++-
|
|
|
2fc102 |
1 file changed, 41 insertions(+), 1 deletion(-)
|
|
|
2fc102 |
|
|
|
2fc102 |
diff --git a/src/providers/ldap/sdap_async_enum.c b/src/providers/ldap/sdap_async_enum.c
|
|
|
2fc102 |
index 0c20afa9d7a1b0198bb71cffdafcb14763c1dafb..0431d03c38098080847035d522ab5f1f494b8bfe 100644
|
|
|
2fc102 |
--- a/src/providers/ldap/sdap_async_enum.c
|
|
|
2fc102 |
+++ b/src/providers/ldap/sdap_async_enum.c
|
|
|
2fc102 |
@@ -235,7 +235,7 @@ static void sdap_dom_enum_ex_posix_check_done(struct tevent_req *subreq)
|
|
|
2fc102 |
|
|
|
2fc102 |
ret = sdap_posix_check_recv(subreq, &has_posix);
|
|
|
2fc102 |
talloc_zfree(subreq);
|
|
|
2fc102 |
- if (ret != EOK) {
|
|
|
2fc102 |
+ if (ret != EOK && ret != ERR_NO_POSIX) {
|
|
|
2fc102 |
/* We can only finish the id_op on error as the connection
|
|
|
2fc102 |
* is re-used by the user search
|
|
|
2fc102 |
*/
|
|
|
2fc102 |
@@ -248,6 +248,16 @@ static void sdap_dom_enum_ex_posix_check_done(struct tevent_req *subreq)
|
|
|
2fc102 |
tevent_req_error(req, ret);
|
|
|
2fc102 |
}
|
|
|
2fc102 |
return;
|
|
|
2fc102 |
+ } else if (dp_error == DP_ERR_OFFLINE) {
|
|
|
2fc102 |
+ DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n"));
|
|
|
2fc102 |
+ tevent_req_done(req);
|
|
|
2fc102 |
+ return;
|
|
|
2fc102 |
+ } else {
|
|
|
2fc102 |
+ /* Non-recoverable error */
|
|
|
2fc102 |
+ DEBUG(SSSDBG_OP_FAILURE,
|
|
|
2fc102 |
+ ("POSIX check failed: %d: %s\n", ret, sss_strerror(ret)));
|
|
|
2fc102 |
+ tevent_req_error(req, ret);
|
|
|
2fc102 |
+ return;
|
|
|
2fc102 |
}
|
|
|
2fc102 |
}
|
|
|
2fc102 |
|
|
|
2fc102 |
@@ -306,6 +316,16 @@ static void sdap_dom_enum_ex_users_done(struct tevent_req *subreq)
|
|
|
2fc102 |
return;
|
|
|
2fc102 |
}
|
|
|
2fc102 |
return;
|
|
|
2fc102 |
+ } else if (dp_error == DP_ERR_OFFLINE) {
|
|
|
2fc102 |
+ DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n"));
|
|
|
2fc102 |
+ tevent_req_done(req);
|
|
|
2fc102 |
+ return;
|
|
|
2fc102 |
+ } else if (ret != EOK && ret != ENOENT) {
|
|
|
2fc102 |
+ /* Non-recoverable error */
|
|
|
2fc102 |
+ DEBUG(SSSDBG_OP_FAILURE,
|
|
|
2fc102 |
+ ("User enumeration failed: %d: %s\n", ret, sss_strerror(ret)));
|
|
|
2fc102 |
+ tevent_req_error(req, ret);
|
|
|
2fc102 |
+ return;
|
|
|
2fc102 |
}
|
|
|
2fc102 |
|
|
|
2fc102 |
state->group_op = sdap_id_op_create(state, state->group_conn->conn_cache);
|
|
|
2fc102 |
@@ -367,6 +387,16 @@ static void sdap_dom_enum_ex_groups_done(struct tevent_req *subreq)
|
|
|
2fc102 |
return;
|
|
|
2fc102 |
}
|
|
|
2fc102 |
return;
|
|
|
2fc102 |
+ } else if (dp_error == DP_ERR_OFFLINE) {
|
|
|
2fc102 |
+ DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n"));
|
|
|
2fc102 |
+ tevent_req_done(req);
|
|
|
2fc102 |
+ return;
|
|
|
2fc102 |
+ } else if (ret != EOK && ret != ENOENT) {
|
|
|
2fc102 |
+ /* Non-recoverable error */
|
|
|
2fc102 |
+ DEBUG(SSSDBG_OP_FAILURE,
|
|
|
2fc102 |
+ ("Group enumeration failed: %d: %s\n", ret, sss_strerror(ret)));
|
|
|
2fc102 |
+ tevent_req_error(req, ret);
|
|
|
2fc102 |
+ return;
|
|
|
2fc102 |
}
|
|
|
2fc102 |
|
|
|
2fc102 |
|
|
|
2fc102 |
@@ -426,6 +456,16 @@ static void sdap_dom_enum_ex_svcs_done(struct tevent_req *subreq)
|
|
|
2fc102 |
return;
|
|
|
2fc102 |
}
|
|
|
2fc102 |
return;
|
|
|
2fc102 |
+ } else if (dp_error == DP_ERR_OFFLINE) {
|
|
|
2fc102 |
+ DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n"));
|
|
|
2fc102 |
+ tevent_req_done(req);
|
|
|
2fc102 |
+ return;
|
|
|
2fc102 |
+ } else if (ret != EOK && ret != ENOENT) {
|
|
|
2fc102 |
+ /* Non-recoverable error */
|
|
|
2fc102 |
+ DEBUG(SSSDBG_OP_FAILURE,
|
|
|
2fc102 |
+ ("Service enumeration failed: %d: %s\n", ret, sss_strerror(ret)));
|
|
|
2fc102 |
+ tevent_req_error(req, ret);
|
|
|
2fc102 |
+ return;
|
|
|
2fc102 |
}
|
|
|
2fc102 |
|
|
|
2fc102 |
/* Ok, we've completed an enumeration. Save this to the
|
|
|
2fc102 |
--
|
|
|
2fc102 |
1.8.5.3
|
|
|
2fc102 |
|