From cbaba2f47da96c4191971bce86f03afb3f88864a Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 11 Jan 2013 18:13:36 -0500 Subject: Add be_req_get_data() helper funciton. In preparation for making struct be_req opaque. --- src/providers/ipa/ipa_access.c | 6 +++--- src/providers/ipa/ipa_auth.c | 3 ++- src/providers/ipa/ipa_hostid.c | 2 +- src/providers/ipa/ipa_id.c | 4 ++-- src/providers/ipa/ipa_selinux.c | 5 +++-- 5 files changed, 11 insertions(+), 9 deletions(-) (limited to 'src/providers/ipa') diff --git a/src/providers/ipa/ipa_access.c b/src/providers/ipa/ipa_access.c index 7a3dbaaf2..430b2f7a9 100644 --- a/src/providers/ipa/ipa_access.c +++ b/src/providers/ipa/ipa_access.c @@ -39,7 +39,7 @@ static void ipa_access_reply(struct hbac_ctx *hbac_ctx, int pam_status) { struct be_req *be_req = hbac_ctx->be_req; struct pam_data *pd; - pd = talloc_get_type(be_req->req_data, struct pam_data); + pd = talloc_get_type(be_req_get_data(be_req), struct pam_data); pd->pam_status = pam_status; /* destroy HBAC context now to release all used resources and LDAP connection */ @@ -80,7 +80,7 @@ void ipa_access_handler(struct be_req *be_req) struct tevent_req *req; struct be_ctx *be_ctx = be_req_get_be_ctx(be_req); - pd = talloc_get_type(be_req->req_data, struct pam_data); + pd = talloc_get_type(be_req_get_data(be_req), struct pam_data); ipa_access_ctx = talloc_get_type(be_ctx->bet_info[BET_ACCESS].pvt_bet_data, struct ipa_access_ctx); @@ -112,7 +112,7 @@ static void ipa_hbac_check(struct tevent_req *req) be_req = tevent_req_callback_data(req, struct be_req); be_ctx = be_req_get_be_ctx(be_req); - pd = talloc_get_type(be_req->req_data, struct pam_data); + pd = talloc_get_type(be_req_get_data(be_req), struct pam_data); ret = sdap_access_recv(req, &pam_status); talloc_zfree(req); diff --git a/src/providers/ipa/ipa_auth.c b/src/providers/ipa/ipa_auth.c index 5c5b34ae3..2a033db94 100644 --- a/src/providers/ipa/ipa_auth.c +++ b/src/providers/ipa/ipa_auth.c @@ -189,7 +189,8 @@ void ipa_auth(struct be_req *be_req) { struct tevent_req *req; struct ipa_auth_state *state; - struct pam_data *pd = talloc_get_type(be_req->req_data, struct pam_data); + struct pam_data *pd = + talloc_get_type(be_req_get_data(be_req), struct pam_data); struct be_ctx *be_ctx = be_req_get_be_ctx(be_req); state = talloc_zero(be_req, struct ipa_auth_state); diff --git a/src/providers/ipa/ipa_hostid.c b/src/providers/ipa/ipa_hostid.c index 448914ba8..cb37e9a4d 100644 --- a/src/providers/ipa/ipa_hostid.c +++ b/src/providers/ipa/ipa_hostid.c @@ -75,7 +75,7 @@ ipa_host_info_handler(struct be_req *breq) goto done; } - hr = talloc_get_type(breq->req_data, struct be_host_req); + hr = talloc_get_type(be_req_get_data(breq), struct be_host_req); if (hr->filter_type != BE_FILTER_NAME) { ret = EINVAL; diff --git a/src/providers/ipa/ipa_id.c b/src/providers/ipa/ipa_id.c index 0344a1842..5f94eb2c1 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) return sdap_handler_done(breq, DP_ERR_OFFLINE, EAGAIN, "Offline"); } - ar = talloc_get_type(breq->req_data, struct be_acct_req); + ar = talloc_get_type(be_req_get_data(breq), struct be_acct_req); if (strcasecmp(ar->domain, be_ctx->domain->name) != 0) { /* if domain names do not match, this is a subdomain case */ @@ -110,7 +110,7 @@ void ipa_account_info_handler(struct be_req *breq) static void ipa_account_info_done(struct tevent_req *req) { struct be_req *breq = tevent_req_callback_data(req, struct be_req); - struct be_acct_req *ar = talloc_get_type(breq->req_data, + struct be_acct_req *ar = talloc_get_type(be_req_get_data(breq), struct be_acct_req); const char *error_text; int ret, dp_error; diff --git a/src/providers/ipa/ipa_selinux.c b/src/providers/ipa/ipa_selinux.c index 2203069c9..29e988704 100644 --- a/src/providers/ipa/ipa_selinux.c +++ b/src/providers/ipa/ipa_selinux.c @@ -89,7 +89,7 @@ void ipa_selinux_handler(struct be_req *be_req) struct pam_data *pd; const char *hostname; - pd = talloc_get_type(be_req->req_data, struct pam_data); + pd = talloc_get_type(be_req_get_data(be_req), struct pam_data); selinux_ctx = talloc_get_type(be_ctx->bet_info[BET_SELINUX].pvt_bet_data, struct ipa_selinux_ctx); @@ -194,7 +194,8 @@ static void ipa_selinux_handler_done(struct tevent_req *req) struct sysdb_attrs **maps = NULL; bool in_transaction = false; char *default_user = NULL; - struct pam_data *pd = talloc_get_type(breq->req_data, struct pam_data); + struct pam_data *pd = + talloc_get_type(be_req_get_data(breq), struct pam_data); char *map_order = NULL; size_t hbac_count = 0; struct sysdb_attrs **hbac_rules = 0; -- cgit