diff options
author | Ondrej Kos <okos@redhat.com> | 2013-08-05 13:44:15 +0200 |
---|---|---|
committer | Ondrej Kos <okos@redhat.com> | 2013-09-04 09:34:40 +0200 |
commit | 28719c1a91f39b99b6a2e7ec4c9052a6fd41b807 (patch) | |
tree | 902b8e8c0b995db471532e623be80e98589972f0 | |
parent | 57c2a7c4390a1549a2dbe3c6ae25fffd1e6e9f4d (diff) | |
download | sssd-28719c1a91f39b99b6a2e7ec4c9052a6fd41b807.tar.gz sssd-28719c1a91f39b99b6a2e7ec4c9052a6fd41b807.tar.xz sssd-28719c1a91f39b99b6a2e7ec4c9052a6fd41b807.zip |
Clean list of domain requests
https://fedorahosted.org/sssd/ticket/1968
When subdomain is removed, there still might be some requests pending.
Provided function goes through the list and matching requests are removed.
-rw-r--r-- | src/providers/ad/ad_subdomains.c | 1 | ||||
-rw-r--r-- | src/providers/data_provider_be.c | 17 | ||||
-rw-r--r-- | src/providers/dp_backend.h | 2 | ||||
-rw-r--r-- | src/providers/ipa/ipa_subdomains.c | 1 |
4 files changed, 21 insertions, 0 deletions
diff --git a/src/providers/ad/ad_subdomains.c b/src/providers/ad/ad_subdomains.c index 6e44680e..12965a4f 100644 --- a/src/providers/ad/ad_subdomains.c +++ b/src/providers/ad/ad_subdomains.c @@ -208,6 +208,7 @@ static errno_t ad_subdomains_refresh(struct ad_subdomains_ctx *ctx, } /* Remove the subdomain from the list of LDAP domains */ + be_clean_dom_req_list(ctx->be_ctx, dom->name); sdap_domain_remove(ctx->sdap_id_ctx->opts, dom); } else { /* ok let's try to update it */ diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 52dc5e03..e751b464 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -454,6 +454,23 @@ done: talloc_free(next_be_req); } +void be_clean_dom_req_list(struct be_ctx *be_ctx, const char *domain_name) +{ + struct be_req *be_req; + + DEBUG(SSSDBG_TRACE_FUNC, + ("Removing requests for domain %s\n", domain_name)); + + DLIST_FOR_EACH(be_req, be_ctx->be_reqlist) { + + if (be_req->domain_name == NULL) continue; + + if (strcmp(domain_name, be_req->domain_name) == 0) { + be_req_terminate(be_req, DP_ERR_FATAL, EIO, NULL); + } + } +} + bool be_is_offline(struct be_ctx *ctx) { time_t now = time(NULL); diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h index 42e03647..5763c122 100644 --- a/src/providers/dp_backend.h +++ b/src/providers/dp_backend.h @@ -211,6 +211,8 @@ int be_add_offline_cb(TALLOC_CTX *mem_ctx, struct be_cb **online_cb); void be_run_offline_cb(struct be_ctx *be); +void be_clean_dom_req_list(struct be_ctx *be_ctx, const char *domain_name); + /* from data_provider_fo.c */ enum be_fo_protocol { BE_FO_PROTO_TCP, diff --git a/src/providers/ipa/ipa_subdomains.c b/src/providers/ipa/ipa_subdomains.c index 8c3f1765..cf483df5 100644 --- a/src/providers/ipa/ipa_subdomains.c +++ b/src/providers/ipa/ipa_subdomains.c @@ -551,6 +551,7 @@ static errno_t ipa_subdomains_refresh(struct ipa_subdomains_ctx *ctx, } /* Remove the AD ID ctx from the list of LDAP domains */ + be_clean_dom_req_list(ctx->be_ctx, dom->name); ipa_ad_subdom_remove(ctx, dom); } else { /* ok let's try to update it */ |