summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2015-02-13 13:49:17 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-03-08 22:27:10 +0100
commita849d848d53f305a90613a74c1767a42b250deda (patch)
treed959733f09e2a5ab73f81825cc3155c90136e296 /src/providers
parentb0d3164ca2bd842e176268c26935c5ce54f7f76e (diff)
downloadsssd-a849d848d53f305a90613a74c1767a42b250deda.tar.gz
sssd-a849d848d53f305a90613a74c1767a42b250deda.tar.xz
sssd-a849d848d53f305a90613a74c1767a42b250deda.zip
sdap_handle_acct_req_send: remove be_req
be_req was used only as a talloc context for subreq. This memory context was replace by state of the parent request which is more suitable for tevent coding style. This change will allow us to use this function in be_refresh where none be_req is available. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/ad/ad_id.c2
-rw-r--r--src/providers/ipa/ipa_id.c2
-rw-r--r--src/providers/ldap/ldap_common.h2
-rw-r--r--src/providers/ldap/ldap_id.c24
4 files changed, 13 insertions, 17 deletions
diff --git a/src/providers/ad/ad_id.c b/src/providers/ad/ad_id.c
index 995a71277..ab3934727 100644
--- a/src/providers/ad/ad_id.c
+++ b/src/providers/ad/ad_id.c
@@ -120,7 +120,7 @@ ad_handle_acct_info_step(struct tevent_req *req)
noexist_delete = true;
}
- subreq = sdap_handle_acct_req_send(state, state->breq,
+ subreq = sdap_handle_acct_req_send(state, state->ctx->be,
state->ar, state->ctx,
state->sdom,
state->conn[state->cindex],
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index e975c676a..dcfa2b648 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -743,7 +743,7 @@ static errno_t ipa_id_get_account_info_get_original_step(struct tevent_req *req,
struct ipa_id_get_account_info_state);
struct tevent_req *subreq;
- subreq = sdap_handle_acct_req_send(state, state->be_req, ar,
+ subreq = sdap_handle_acct_req_send(state, state->ctx->be, ar,
state->ipa_ctx->sdap_id_ctx,
state->ipa_ctx->sdap_id_ctx->opts->sdom,
state->ipa_ctx->sdap_id_ctx->conn, true);
diff --git a/src/providers/ldap/ldap_common.h b/src/providers/ldap/ldap_common.h
index c377b7c2a..f8b4e0142 100644
--- a/src/providers/ldap/ldap_common.h
+++ b/src/providers/ldap/ldap_common.h
@@ -104,7 +104,7 @@ int sdap_id_setup_tasks(struct be_ctx *be_ctx,
struct tevent_req *
sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
- struct be_req *breq,
+ struct be_ctx *be_ctx,
struct be_acct_req *ar,
struct sdap_id_ctx *id_ctx,
struct sdap_domain *sdom,
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c
index 226ea6057..4705714ad 100644
--- a/src/providers/ldap/ldap_id.c
+++ b/src/providers/ldap/ldap_id.c
@@ -1311,7 +1311,6 @@ void sdap_account_info_handler(struct be_req *breq)
/* A generic LDAP account info handler */
struct sdap_handle_acct_req_state {
- struct be_req *breq;
struct be_acct_req *ar;
const char *err;
int dp_error;
@@ -1322,7 +1321,7 @@ static void sdap_handle_acct_req_done(struct tevent_req *subreq);
struct tevent_req *
sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
- struct be_req *breq,
+ struct be_ctx *be_ctx,
struct be_acct_req *ar,
struct sdap_id_ctx *id_ctx,
struct sdap_domain *sdom,
@@ -1331,11 +1330,9 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
{
struct tevent_req *req;
struct tevent_req *subreq;
- struct be_ctx *be_ctx;
struct sdap_handle_acct_req_state *state;
errno_t ret;
- be_ctx = be_req_get_be_ctx(breq);
req = tevent_req_create(mem_ctx, &state,
struct sdap_handle_acct_req_state);
@@ -1343,7 +1340,6 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
ret = ENOMEM;
goto done;
}
- state->breq = breq;
state->ar = ar;
if (ar == NULL) {
@@ -1363,7 +1359,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = users_get_send(breq, be_ctx->ev, id_ctx,
+ subreq = users_get_send(state, be_ctx->ev, id_ctx,
sdom, conn,
ar->filter_value,
ar->filter_type,
@@ -1383,7 +1379,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = groups_get_send(breq, be_ctx->ev, id_ctx,
+ subreq = groups_get_send(state, be_ctx->ev, id_ctx,
sdom, conn,
ar->filter_value,
ar->filter_type,
@@ -1403,7 +1399,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = groups_by_user_send(breq, be_ctx->ev, id_ctx,
+ subreq = groups_by_user_send(state, be_ctx->ev, id_ctx,
sdom, conn,
ar->filter_value,
ar->extra_value,
@@ -1417,7 +1413,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = ldap_netgroup_get_send(breq, be_ctx->ev, id_ctx,
+ subreq = ldap_netgroup_get_send(state, be_ctx->ev, id_ctx,
sdom, conn,
ar->filter_value,
noexist_delete);
@@ -1440,7 +1436,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = services_get_send(breq, be_ctx->ev, id_ctx,
+ subreq = services_get_send(state, be_ctx->ev, id_ctx,
sdom, conn,
ar->filter_value,
ar->extra_value,
@@ -1455,7 +1451,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = get_user_and_group_send(breq, be_ctx->ev, id_ctx,
+ subreq = get_user_and_group_send(state, be_ctx->ev, id_ctx,
sdom, conn,
ar->filter_value,
ar->filter_type,
@@ -1470,7 +1466,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = get_user_and_group_send(breq, be_ctx->ev, id_ctx,
+ subreq = get_user_and_group_send(state, be_ctx->ev, id_ctx,
sdom, conn,
ar->filter_value,
ar->filter_type,
@@ -1486,7 +1482,7 @@ sdap_handle_acct_req_send(TALLOC_CTX *mem_ctx,
goto done;
}
- subreq = get_user_and_group_send(breq, be_ctx->ev, id_ctx,
+ subreq = get_user_and_group_send(state, be_ctx->ev, id_ctx,
sdom, conn,
ar->filter_value,
ar->filter_type,
@@ -1618,7 +1614,7 @@ void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx,
EINVAL, "Invalid private data");
}
- req = sdap_handle_acct_req_send(breq, breq, ar, ctx,
+ req = sdap_handle_acct_req_send(breq, ctx->be, ar, ctx,
ctx->opts->sdom, conn, true);
if (req == NULL) {
return sdap_handler_done(breq, DP_ERR_FATAL, ENOMEM, "Out of memory");