|
|
b2d430 |
From 9812095cc83c7258584235528d355c301c492b92 Mon Sep 17 00:00:00 2001
|
|
|
b2d430 |
From: Sumit Bose <sbose@redhat.com>
|
|
|
b2d430 |
Date: Tue, 12 Jul 2016 17:09:00 +0200
|
|
|
b2d430 |
Subject: [PATCH 45/62] IPA: make ipa_resolve_user_list_{send|recv} public and
|
|
|
b2d430 |
allow AD users
|
|
|
b2d430 |
|
|
|
b2d430 |
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
b2d430 |
(cherry picked from commit f2e8a7c3230fac11175c0bd17c14c66a8e9b25ad)
|
|
|
b2d430 |
---
|
|
|
b2d430 |
src/providers/ipa/ipa_id.c | 20 ++++++++++++++++----
|
|
|
b2d430 |
src/providers/ipa/ipa_id.h | 8 ++++++++
|
|
|
b2d430 |
2 files changed, 24 insertions(+), 4 deletions(-)
|
|
|
b2d430 |
|
|
|
b2d430 |
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
|
|
|
b2d430 |
index e092cd2f80d3c102f88a9bc48a352e1a140b14e8..7cc79f92b5dcd481706353d403125c46d587e7f6 100644
|
|
|
b2d430 |
--- a/src/providers/ipa/ipa_id.c
|
|
|
b2d430 |
+++ b/src/providers/ipa/ipa_id.c
|
|
|
b2d430 |
@@ -71,7 +71,7 @@ struct ipa_resolve_user_list_state {
|
|
|
b2d430 |
static errno_t ipa_resolve_user_list_get_user_step(struct tevent_req *req);
|
|
|
b2d430 |
static void ipa_resolve_user_list_get_user_done(struct tevent_req *subreq);
|
|
|
b2d430 |
|
|
|
b2d430 |
-static struct tevent_req *
|
|
|
b2d430 |
+struct tevent_req *
|
|
|
b2d430 |
ipa_resolve_user_list_send(TALLOC_CTX *memctx, struct tevent_context *ev,
|
|
|
b2d430 |
struct ipa_id_ctx *ipa_ctx,
|
|
|
b2d430 |
const char *domain_name,
|
|
|
b2d430 |
@@ -132,7 +132,14 @@ static errno_t ipa_resolve_user_list_get_user_step(struct tevent_req *req)
|
|
|
b2d430 |
|
|
|
b2d430 |
DEBUG(SSSDBG_TRACE_ALL, "Trying to resolve user [%s].\n", ar->filter_value);
|
|
|
b2d430 |
|
|
|
b2d430 |
- subreq = ipa_id_get_account_info_send(state, state->ev, state->ipa_ctx, ar);
|
|
|
b2d430 |
+ if (strcasecmp(state->domain_name,
|
|
|
b2d430 |
+ state->ipa_ctx->sdap_id_ctx->be->domain->name) != 0) {
|
|
|
b2d430 |
+ subreq = ipa_subdomain_account_send(state, state->ev, state->ipa_ctx,
|
|
|
b2d430 |
+ ar);
|
|
|
b2d430 |
+ } else {
|
|
|
b2d430 |
+ subreq = ipa_id_get_account_info_send(state, state->ev, state->ipa_ctx,
|
|
|
b2d430 |
+ ar);
|
|
|
b2d430 |
+ }
|
|
|
b2d430 |
if (subreq == NULL) {
|
|
|
b2d430 |
DEBUG(SSSDBG_OP_FAILURE, "sdap_handle_acct_req_send failed.\n");
|
|
|
b2d430 |
return ENOMEM;
|
|
|
b2d430 |
@@ -151,7 +158,12 @@ static void ipa_resolve_user_list_get_user_done(struct tevent_req *subreq)
|
|
|
b2d430 |
struct ipa_resolve_user_list_state);
|
|
|
b2d430 |
int ret;
|
|
|
b2d430 |
|
|
|
b2d430 |
- ret = ipa_id_get_account_info_recv(subreq, &state->dp_error);
|
|
|
b2d430 |
+ if (strcasecmp(state->domain_name,
|
|
|
b2d430 |
+ state->ipa_ctx->sdap_id_ctx->be->domain->name) != 0) {
|
|
|
b2d430 |
+ ret = ipa_subdomain_account_recv(subreq, &state->dp_error);
|
|
|
b2d430 |
+ } else {
|
|
|
b2d430 |
+ ret = ipa_id_get_account_info_recv(subreq, &state->dp_error);
|
|
|
b2d430 |
+ }
|
|
|
b2d430 |
talloc_zfree(subreq);
|
|
|
b2d430 |
if (ret != EOK) {
|
|
|
b2d430 |
DEBUG(SSSDBG_OP_FAILURE, "sdap_handle_acct request failed: %d\n", ret);
|
|
|
b2d430 |
@@ -182,7 +194,7 @@ done:
|
|
|
b2d430 |
return;
|
|
|
b2d430 |
}
|
|
|
b2d430 |
|
|
|
b2d430 |
-static int ipa_resolve_user_list_recv(struct tevent_req *req, int *dp_error)
|
|
|
b2d430 |
+int ipa_resolve_user_list_recv(struct tevent_req *req, int *dp_error)
|
|
|
b2d430 |
{
|
|
|
b2d430 |
struct ipa_resolve_user_list_state *state = tevent_req_data(req,
|
|
|
b2d430 |
struct ipa_resolve_user_list_state);
|
|
|
b2d430 |
diff --git a/src/providers/ipa/ipa_id.h b/src/providers/ipa/ipa_id.h
|
|
|
b2d430 |
index 17db5226a29a54485f7b26eb9853ef2380426bdf..485fa3f8e6af48ddcf1178c3486456753035c948 100644
|
|
|
b2d430 |
--- a/src/providers/ipa/ipa_id.h
|
|
|
b2d430 |
+++ b/src/providers/ipa/ipa_id.h
|
|
|
b2d430 |
@@ -135,4 +135,12 @@ struct tevent_req *ipa_get_subdom_acct_process_pac_send(TALLOC_CTX *mem_ctx,
|
|
|
b2d430 |
struct ldb_message *user_msg);
|
|
|
b2d430 |
|
|
|
b2d430 |
errno_t ipa_get_subdom_acct_process_pac_recv(struct tevent_req *req);
|
|
|
b2d430 |
+
|
|
|
b2d430 |
+struct tevent_req *
|
|
|
b2d430 |
+ipa_resolve_user_list_send(TALLOC_CTX *memctx, struct tevent_context *ev,
|
|
|
b2d430 |
+ struct ipa_id_ctx *ipa_ctx,
|
|
|
b2d430 |
+ const char *domain_name,
|
|
|
b2d430 |
+ struct ldb_message_element *users);
|
|
|
b2d430 |
+int ipa_resolve_user_list_recv(struct tevent_req *req, int *dp_error);
|
|
|
b2d430 |
+
|
|
|
b2d430 |
#endif
|
|
|
b2d430 |
--
|
|
|
b2d430 |
2.4.11
|
|
|
b2d430 |
|