summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2016-07-12 17:09:00 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-07-29 14:44:18 +0200
commitf2e8a7c3230fac11175c0bd17c14c66a8e9b25ad (patch)
treea6b69c310b350938af90883e7cd43699d6f25ae2
parent19bb5bfc2821c5644e10614c5730ca5c180c2856 (diff)
downloadsssd-f2e8a7c3230fac11175c0bd17c14c66a8e9b25ad.tar.gz
sssd-f2e8a7c3230fac11175c0bd17c14c66a8e9b25ad.tar.xz
sssd-f2e8a7c3230fac11175c0bd17c14c66a8e9b25ad.zip
IPA: make ipa_resolve_user_list_{send|recv} public and allow AD users
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
-rw-r--r--src/providers/ipa/ipa_id.c20
-rw-r--r--src/providers/ipa/ipa_id.h8
2 files changed, 24 insertions, 4 deletions
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index cfc25b9b3..7f0cd5689 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -71,7 +71,7 @@ struct ipa_resolve_user_list_state {
static errno_t ipa_resolve_user_list_get_user_step(struct tevent_req *req);
static void ipa_resolve_user_list_get_user_done(struct tevent_req *subreq);
-static struct tevent_req *
+struct tevent_req *
ipa_resolve_user_list_send(TALLOC_CTX *memctx, struct tevent_context *ev,
struct ipa_id_ctx *ipa_ctx,
const char *domain_name,
@@ -132,7 +132,14 @@ 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 = ipa_id_get_account_info_send(state, state->ev, state->ipa_ctx, ar);
+ if (strcasecmp(state->domain_name,
+ state->ipa_ctx->sdap_id_ctx->be->domain->name) != 0) {
+ subreq = ipa_subdomain_account_send(state, state->ev, state->ipa_ctx,
+ ar);
+ } else {
+ subreq = ipa_id_get_account_info_send(state, state->ev, state->ipa_ctx,
+ ar);
+ }
if (subreq == NULL) {
DEBUG(SSSDBG_OP_FAILURE, "sdap_handle_acct_req_send failed.\n");
return ENOMEM;
@@ -151,7 +158,12 @@ static void ipa_resolve_user_list_get_user_done(struct tevent_req *subreq)
struct ipa_resolve_user_list_state);
int ret;
- ret = ipa_id_get_account_info_recv(subreq, &state->dp_error);
+ if (strcasecmp(state->domain_name,
+ state->ipa_ctx->sdap_id_ctx->be->domain->name) != 0) {
+ ret = ipa_subdomain_account_recv(subreq, &state->dp_error);
+ } else {
+ 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);
@@ -182,7 +194,7 @@ done:
return;
}
-static int ipa_resolve_user_list_recv(struct tevent_req *req, int *dp_error)
+int ipa_resolve_user_list_recv(struct tevent_req *req, int *dp_error)
{
struct ipa_resolve_user_list_state *state = tevent_req_data(req,
struct ipa_resolve_user_list_state);
diff --git a/src/providers/ipa/ipa_id.h b/src/providers/ipa/ipa_id.h
index 410c20868..4b2549882 100644
--- a/src/providers/ipa/ipa_id.h
+++ b/src/providers/ipa/ipa_id.h
@@ -135,4 +135,12 @@ struct tevent_req *ipa_get_subdom_acct_process_pac_send(TALLOC_CTX *mem_ctx,
struct ldb_message *user_msg);
errno_t ipa_get_subdom_acct_process_pac_recv(struct tevent_req *req);
+
+struct tevent_req *
+ipa_resolve_user_list_send(TALLOC_CTX *memctx, struct tevent_context *ev,
+ struct ipa_id_ctx *ipa_ctx,
+ const char *domain_name,
+ struct ldb_message_element *users);
+int ipa_resolve_user_list_recv(struct tevent_req *req, int *dp_error);
+
#endif