summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/providers/ipa/ipa_id.c2
-rw-r--r--src/providers/ipa/ipa_init.c4
-rw-r--r--src/providers/ldap/ldap_common.h1
-rw-r--r--src/providers/ldap/ldap_id.c15
4 files changed, 18 insertions, 4 deletions
diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c
index 14a344f2a..a014c9f20 100644
--- a/src/providers/ipa/ipa_id.c
+++ b/src/providers/ipa/ipa_id.c
@@ -80,7 +80,7 @@ void ipa_account_info_handler(struct be_req *breq)
case BE_REQ_USER: /* user */
case BE_REQ_GROUP: /* group */
case BE_REQ_INITGROUPS: /* init groups for user */
- return sdap_account_info_handler(breq);
+ return sdap_handle_account_info(breq, ctx);
case BE_REQ_NETGROUP:
if (ar->filter_type != BE_FILTER_NAME) {
diff --git a/src/providers/ipa/ipa_init.c b/src/providers/ipa/ipa_init.c
index 8b553ef06..9fbca3ae4 100644
--- a/src/providers/ipa/ipa_init.c
+++ b/src/providers/ipa/ipa_init.c
@@ -351,6 +351,7 @@ int sssm_ipa_access_init(struct be_ctx *bectx,
{
int ret;
struct ipa_access_ctx *ipa_access_ctx;
+ struct ipa_id_ctx *id_ctx;
ipa_access_ctx = talloc_zero(bectx, struct ipa_access_ctx);
if (ipa_access_ctx == NULL) {
@@ -358,11 +359,12 @@ int sssm_ipa_access_init(struct be_ctx *bectx,
return ENOMEM;
}
- ret = sssm_ipa_id_init(bectx, ops, (void **) &ipa_access_ctx->sdap_ctx);
+ ret = sssm_ipa_id_init(bectx, ops, (void **) &id_ctx);
if (ret != EOK) {
DEBUG(1, ("sssm_ipa_id_init failed.\n"));
goto done;
}
+ ipa_access_ctx->sdap_ctx = id_ctx->sdap_id_ctx;
ret = dp_copy_options(ipa_access_ctx, ipa_options->basic,
IPA_OPTS_BASIC, &ipa_access_ctx->ipa_options);
diff --git a/src/providers/ldap/ldap_common.h b/src/providers/ldap/ldap_common.h
index 2c77846e9..e937cf2cd 100644
--- a/src/providers/ldap/ldap_common.h
+++ b/src/providers/ldap/ldap_common.h
@@ -71,6 +71,7 @@ struct sdap_auth_ctx {
void sdap_check_online(struct be_req *breq);
/* id */
void sdap_account_info_handler(struct be_req *breq);
+void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx);
int sdap_id_setup_tasks(struct sdap_id_ctx *ctx);
/* auth */
diff --git a/src/providers/ldap/ldap_id.c b/src/providers/ldap/ldap_id.c
index b8e9563bd..bd46dc9d8 100644
--- a/src/providers/ldap/ldap_id.c
+++ b/src/providers/ldap/ldap_id.c
@@ -732,17 +732,28 @@ static void sdap_account_info_users_done(struct tevent_req *req);
static void sdap_account_info_groups_done(struct tevent_req *req);
static void sdap_account_info_initgr_done(struct tevent_req *req);
static void sdap_account_info_netgroups_done(struct tevent_req *req);
+void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx);
void sdap_account_info_handler(struct be_req *breq)
{
struct sdap_id_ctx *ctx;
+
+ ctx = talloc_get_type(breq->be_ctx->bet_info[BET_ID].pvt_bet_data, struct sdap_id_ctx);
+ if (!ctx) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("Could not get sdap ctx\n"));
+ return sdap_handler_done(breq, DP_ERR_FATAL,
+ EINVAL, "Invalid request data\n");
+ }
+ return sdap_handle_account_info(breq, ctx);
+}
+
+void sdap_handle_account_info(struct be_req *breq, struct sdap_id_ctx *ctx)
+{
struct be_acct_req *ar;
struct tevent_req *req;
const char *err = "Unknown Error";
int ret = EOK;
- ctx = talloc_get_type(breq->be_ctx->bet_info[BET_ID].pvt_bet_data, struct sdap_id_ctx);
-
if (be_is_offline(ctx->be)) {
return sdap_handler_done(breq, DP_ERR_OFFLINE, EAGAIN, "Offline");
}