diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-21 03:37:47 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-28 18:06:57 +0200 |
commit | 34a63c4a00096da7a8e09d49b5970bb1f807eddc (patch) | |
tree | 48aba71a3206145b2418579dc492721c5f92c283 /src/providers/ldap/sdap_async_enum.c | |
parent | 5894f059b6f97a9dfd63f6e9ab544c636dd58665 (diff) | |
download | sssd-34a63c4a00096da7a8e09d49b5970bb1f807eddc.tar.gz sssd-34a63c4a00096da7a8e09d49b5970bb1f807eddc.tar.xz sssd-34a63c4a00096da7a8e09d49b5970bb1f807eddc.zip |
LDAP: Make cleanup synchronous
The LDAP cleanup request was asynchronous for no good reason, probably a
leftover from the days of async sysdb. This patch makes it sychronous
again, removing a lot of uneeded code.
Diffstat (limited to 'src/providers/ldap/sdap_async_enum.c')
-rw-r--r-- | src/providers/ldap/sdap_async_enum.c | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/src/providers/ldap/sdap_async_enum.c b/src/providers/ldap/sdap_async_enum.c index ab6ae0773..b34b801a3 100644 --- a/src/providers/ldap/sdap_async_enum.c +++ b/src/providers/ldap/sdap_async_enum.c @@ -31,10 +31,6 @@ #include "providers/ldap/sdap_async.h" #include "providers/ldap/sdap_idmap.h" -extern struct tevent_req *ldap_id_cleanup_send(TALLOC_CTX *memctx, - struct tevent_context *ev, - struct sdap_id_ctx *ctx); - static struct tevent_req *enum_users_send(TALLOC_CTX *memctx, struct tevent_context *ev, struct sdap_id_ctx *ctx, @@ -67,7 +63,6 @@ static void sdap_dom_enum_conn_done(struct tevent_req *subreq); static void sdap_dom_enum_users_done(struct tevent_req *subreq); static void sdap_dom_enum_groups_done(struct tevent_req *subreq); static void sdap_dom_enum_services_done(struct tevent_req *subreq); -static void sdap_dom_enum_cleanup_done(struct tevent_req *subreq); struct tevent_req * sdap_dom_enum_send(TALLOC_CTX *memctx, @@ -316,27 +311,18 @@ static void sdap_dom_enum_services_done(struct tevent_req *subreq) } if (state->purge) { - subreq = ldap_id_cleanup_send(state, state->ev, state->ctx); - if (!subreq) { - tevent_req_error(req, ENOMEM); - return; + ret = ldap_id_cleanup(state->ctx); + if (ret != EOK) { + /* Not fatal, worst case we'll have stale entries that would be + * removed on a subsequent online lookup + */ + DEBUG(SSSDBG_MINOR_FAILURE, ("Cleanup failed: %d\n", ret)); } - - tevent_req_set_callback(subreq, sdap_dom_enum_cleanup_done, req); - return; } tevent_req_done(req); } -static void sdap_dom_enum_cleanup_done(struct tevent_req *subreq) -{ - struct tevent_req *req = tevent_req_callback_data(subreq, - struct tevent_req); - talloc_zfree(subreq); - tevent_req_done(req); -} - errno_t sdap_dom_enum_recv(struct tevent_req *req) { TEVENT_REQ_RETURN_ON_ERROR(req); |