diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-11 12:23:51 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-02-12 15:42:40 +0100 |
commit | 93dabb2fe0a798f22bb802b9c6521ab9e6a4ac36 (patch) | |
tree | 83952578f2ac835afd97d2016d710ca1775e9585 | |
parent | d3436880c0ec1a7776698c739d4a3edc9a6ac57c (diff) | |
download | sssd-93dabb2fe0a798f22bb802b9c6521ab9e6a4ac36.tar.gz sssd-93dabb2fe0a798f22bb802b9c6521ab9e6a4ac36.tar.xz sssd-93dabb2fe0a798f22bb802b9c6521ab9e6a4ac36.zip |
LDAP: Handle errors from sdap_id_op properly in enum code
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r-- | src/providers/ldap/sdap_async_enum.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async_enum.c b/src/providers/ldap/sdap_async_enum.c index cbee59ee5..c23a13285 100644 --- a/src/providers/ldap/sdap_async_enum.c +++ b/src/providers/ldap/sdap_async_enum.c @@ -236,7 +236,7 @@ static void sdap_dom_enum_ex_posix_check_done(struct tevent_req *subreq) ret = sdap_posix_check_recv(subreq, &has_posix); talloc_zfree(subreq); - if (ret != EOK) { + if (ret != EOK && ret != ERR_NO_POSIX) { /* We can only finish the id_op on error as the connection * is re-used by the user search */ @@ -249,6 +249,16 @@ static void sdap_dom_enum_ex_posix_check_done(struct tevent_req *subreq) tevent_req_error(req, ret); } return; + } else if (dp_error == DP_ERR_OFFLINE) { + DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n")); + tevent_req_done(req); + return; + } else { + /* Non-recoverable error */ + DEBUG(SSSDBG_OP_FAILURE, + ("POSIX check failed: %d: %s\n", ret, sss_strerror(ret))); + tevent_req_error(req, ret); + return; } } @@ -307,6 +317,16 @@ static void sdap_dom_enum_ex_users_done(struct tevent_req *subreq) return; } return; + } else if (dp_error == DP_ERR_OFFLINE) { + DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n")); + tevent_req_done(req); + return; + } else if (ret != EOK && ret != ENOENT) { + /* Non-recoverable error */ + DEBUG(SSSDBG_OP_FAILURE, + ("User enumeration failed: %d: %s\n", ret, sss_strerror(ret))); + tevent_req_error(req, ret); + return; } state->group_op = sdap_id_op_create(state, state->group_conn->conn_cache); @@ -368,6 +388,16 @@ static void sdap_dom_enum_ex_groups_done(struct tevent_req *subreq) return; } return; + } else if (dp_error == DP_ERR_OFFLINE) { + DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n")); + tevent_req_done(req); + return; + } else if (ret != EOK && ret != ENOENT) { + /* Non-recoverable error */ + DEBUG(SSSDBG_OP_FAILURE, + ("Group enumeration failed: %d: %s\n", ret, sss_strerror(ret))); + tevent_req_error(req, ret); + return; } @@ -427,6 +457,16 @@ static void sdap_dom_enum_ex_svcs_done(struct tevent_req *subreq) return; } return; + } else if (dp_error == DP_ERR_OFFLINE) { + DEBUG(SSSDBG_TRACE_FUNC, ("Backend is offline, retrying later\n")); + tevent_req_done(req); + return; + } else if (ret != EOK && ret != ENOENT) { + /* Non-recoverable error */ + DEBUG(SSSDBG_OP_FAILURE, + ("Service enumeration failed: %d: %s\n", ret, sss_strerror(ret))); + tevent_req_error(req, ret); + return; } /* Ok, we've completed an enumeration. Save this to the |