summaryrefslogtreecommitdiff
path: root/src/providers/ldap
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-11-24 14:39:40 +0100
committerJan Zeleny <jzeleny@redhat.com>2011-11-25 10:08:35 +0100
commitf4093e062cf1646b8f01d7078e63708aeb36a95d (patch)
treeacd5916439aa1b9d2a678fa94ab20235ff5eadd9 /src/providers/ldap
parent3a62a99faf8e12965100d0b26fc9e07752bd3e2d (diff)
downloadsssd-f4093e062cf1646b8f01d7078e63708aeb36a95d.tar.gz
sssd-f4093e062cf1646b8f01d7078e63708aeb36a95d.tar.bz2
sssd-f4093e062cf1646b8f01d7078e63708aeb36a95d.zip
Fix sdap_id_ctx/ipa_id_ctx mismatch in IPA provider
This was causing a segfault during HBAC processing and any ID lookups except for netgroups
Diffstat (limited to 'src/providers/ldap')
-rw-r--r--src/providers/ldap/ldap_common.h1
-rw-r--r--src/providers/ldap/ldap_id.c15
2 files changed, 14 insertions, 2 deletions
diff --git a/src/providers/ldap/ldap_common.h b/src/providers/ldap/ldap_common.h
index 2c77846e..e937cf2c 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 b8e9563b..bd46dc9d 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");
}