From a74c81b88afe4fe592527cc137504cb3d78d4660 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose@redhat.com>
Date: Tue, 13 Jan 2015 11:03:37 +0100
Subject: [PATCH 160/160] IPA: ipa_resolve_user_list_send() take care of
overrides
Currently ipa_resolve_user_list_send() only looks up the related user
objects but do not check for overrides. This patch tries to fix this.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit eab17959df71341073f946c533f59fc5e593b35c)
---
src/providers/ipa/ipa_id.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index 4df6ed0e8ee1e9886151703f424b4580db8799a4..3d6861eeb562683518d425616b0e5c413cddba0b 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -146,7 +146,7 @@ static void ipa_account_info_done(struct tevent_req *req)
struct ipa_resolve_user_list_state {
struct tevent_context *ev;
- struct sdap_id_ctx *sdap_id_ctx;
+ struct ipa_id_ctx *ipa_ctx;
struct be_req *be_req;
struct ldb_message_element *users;
const char *domain_name;
@@ -161,7 +161,7 @@ static void ipa_resolve_user_list_get_user_done(struct tevent_req *subreq);
static struct tevent_req *
ipa_resolve_user_list_send(TALLOC_CTX *memctx, struct tevent_context *ev,
struct be_req *be_req,
- struct sdap_id_ctx *sdap_id_ctx,
+ struct ipa_id_ctx *ipa_ctx,
const char *domain_name,
struct ldb_message_element *users)
{
@@ -177,7 +177,7 @@ ipa_resolve_user_list_send(TALLOC_CTX *memctx, struct tevent_context *ev,
}
state->ev = ev;
- state->sdap_id_ctx = sdap_id_ctx;
+ state->ipa_ctx = ipa_ctx;
state->be_req = be_req;
state->domain_name = domain_name;
state->users = users;
@@ -221,10 +221,8 @@ static errno_t ipa_resolve_user_list_get_user_step(struct tevent_req *req)
DEBUG(SSSDBG_TRACE_ALL, "Trying to resolve user [%s].\n", ar->filter_value);
- subreq = sdap_handle_acct_req_send(state, state->be_req, ar,
- state->sdap_id_ctx,
- state->sdap_id_ctx->opts->sdom,
- state->sdap_id_ctx->conn, true);
+ subreq = ipa_id_get_account_info_send(state, state->ev, state->ipa_ctx,
+ state->be_req, ar);
if (subreq == NULL) {
DEBUG(SSSDBG_OP_FAILURE, "sdap_handle_acct_req_send failed.\n");
return ENOMEM;
@@ -243,7 +241,7 @@ static void ipa_resolve_user_list_get_user_done(struct tevent_req *subreq)
struct ipa_resolve_user_list_state);
int ret;
- ret = sdap_handle_acct_req_recv(subreq, &state->dp_error, NULL, NULL);
+ ret = ipa_id_get_account_info_recv(subreq, &state->dp_error);
talloc_zfree(subreq);
if (ret != EOK) {
DEBUG(SSSDBG_OP_FAILURE, "sdap_handle_acct request failed: %d\n", ret);
@@ -616,7 +614,7 @@ static void ipa_id_get_account_info_orig_done(struct tevent_req *subreq)
if (state->ghosts != NULL) {
/* Resolve ghost members */
subreq = ipa_resolve_user_list_send(state, state->ev, state->be_req,
- state->ipa_ctx->sdap_id_ctx,
+ state->ipa_ctx,
state->domain->name,
state->ghosts);
if (subreq == NULL) {
@@ -682,7 +680,7 @@ static void ipa_id_get_account_info_done(struct tevent_req *subreq)
if (state->ghosts != NULL) {
/* Resolve ghost members */
subreq = ipa_resolve_user_list_send(state, state->ev, state->be_req,
- state->ipa_ctx->sdap_id_ctx,
+ state->ipa_ctx,
state->domain->name,
state->ghosts);
if (subreq == NULL) {
--
2.1.0