summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-10-22 16:00:20 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-10-25 22:12:19 +0200
commita09ef85a90b52c0524af420c18f29f888a723412 (patch)
treecc462ac5523c28d8b00f201f13487e1240b7e028 /src/providers
parent84640544b70fd6f3f8210af4d236702bfef98b37 (diff)
downloadsssd-a09ef85a90b52c0524af420c18f29f888a723412.tar.gz
sssd-a09ef85a90b52c0524af420c18f29f888a723412.tar.xz
sssd-a09ef85a90b52c0524af420c18f29f888a723412.zip
dp: add function to terminate request of specific domain
Resolves: https://fedorahosted.org/sssd/ticket/1968
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/data_provider_be.c20
-rw-r--r--src/providers/dp_backend.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 13772c583..2f27c5012 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -207,6 +207,26 @@ void be_req_terminate(struct be_req *be_req,
be_req->fn(be_req, dp_err_type, errnum, errstr);
}
+void be_terminate_domain_requests(struct be_ctx *be_ctx,
+ const char *domain)
+{
+ struct be_req *be_req = NULL;
+
+ DEBUG(SSSDBG_TRACE_FUNC, ("Terminating requests for domain [%s]\n",
+ domain));
+
+ if (domain == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("BUG: domain is NULL\n"));
+ return;
+ }
+
+ DLIST_FOR_EACH(be_req, be_ctx->active_requests) {
+ if (strcmp(domain, be_req->domain->name) == 0) {
+ be_req_terminate(be_req, DP_ERR_FATAL, ERR_DOMAIN_NOT_FOUND,
+ sss_strerror(ERR_DOMAIN_NOT_FOUND));
+ }
+ }
+}
struct be_async_req {
be_req_fn_t fn;
diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h
index 686b91a25..ed022c207 100644
--- a/src/providers/dp_backend.h
+++ b/src/providers/dp_backend.h
@@ -295,6 +295,9 @@ void *be_req_get_data(struct be_req *be_req);
void be_req_terminate(struct be_req *be_req,
int dp_err_type, int errnum, const char *errstr);
+void be_terminate_domain_requests(struct be_ctx *be_ctx,
+ const char *domain);
+
/* Request account information */
struct tevent_req *
be_get_account_info_send(TALLOC_CTX *mem_ctx,