summaryrefslogtreecommitdiff
path: root/src/providers/krb5
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-11 17:26:19 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-21 22:17:34 +0100
commit03abdaa21ecf562b714f204ca42379ff08626f75 (patch)
tree0b6a9d40fc90292d4cadd4c738b8cda8a5dacd06 /src/providers/krb5
parent99151f2217ddaa179543b89b49f836f29f7dcd2a (diff)
downloadsssd-03abdaa21ecf562b714f204ca42379ff08626f75.tar.gz
sssd-03abdaa21ecf562b714f204ca42379ff08626f75.tar.bz2
sssd-03abdaa21ecf562b714f204ca42379ff08626f75.zip
Add be_req_get_be_ctx() helper.
In preparation for making be_req opaque
Diffstat (limited to 'src/providers/krb5')
-rw-r--r--src/providers/krb5/krb5_auth.c14
-rw-r--r--src/providers/krb5/krb5_wait_queue.c8
2 files changed, 12 insertions, 10 deletions
diff --git a/src/providers/krb5/krb5_auth.c b/src/providers/krb5/krb5_auth.c
index e3fd5f78..fd521c30 100644
--- a/src/providers/krb5/krb5_auth.c
+++ b/src/providers/krb5/krb5_auth.c
@@ -213,6 +213,7 @@ static int krb5_delete_ccname(TALLOC_CTX *mem_ctx,
static struct krb5_ctx *get_krb5_ctx(struct be_req *be_req)
{
+ struct be_ctx *be_ctx = be_req_get_be_ctx(be_req);
struct pam_data *pd;
pd = talloc_get_type(be_req->req_data, struct pam_data);
@@ -220,16 +221,16 @@ static struct krb5_ctx *get_krb5_ctx(struct be_req *be_req)
switch (pd->cmd) {
case SSS_PAM_AUTHENTICATE:
case SSS_CMD_RENEW:
- return talloc_get_type(be_req->be_ctx->bet_info[BET_AUTH].pvt_bet_data,
+ return talloc_get_type(be_ctx->bet_info[BET_AUTH].pvt_bet_data,
struct krb5_ctx);
break;
case SSS_PAM_ACCT_MGMT:
- return talloc_get_type(be_req->be_ctx->bet_info[BET_ACCESS].pvt_bet_data,
+ return talloc_get_type(be_ctx->bet_info[BET_ACCESS].pvt_bet_data,
struct krb5_ctx);
break;
case SSS_PAM_CHAUTHTOK:
case SSS_PAM_CHAUTHTOK_PRELIM:
- return talloc_get_type(be_req->be_ctx->bet_info[BET_CHPASS].pvt_bet_data,
+ return talloc_get_type(be_ctx->bet_info[BET_CHPASS].pvt_bet_data,
struct krb5_ctx);
break;
default:
@@ -1126,6 +1127,7 @@ static void krb5_pam_handler_access_done(struct tevent_req *req);
void krb5_pam_handler(struct be_req *be_req)
{
+ struct be_ctx *be_ctx = be_req_get_be_ctx(be_req);
struct tevent_req *req;
struct pam_data *pd;
struct krb5_ctx *krb5_ctx;
@@ -1159,8 +1161,7 @@ void krb5_pam_handler(struct be_req *be_req)
"running request immediately.\n", pd->user));
}
- req = krb5_auth_send(be_req, be_req->be_ctx->ev, be_req->be_ctx, pd,
- krb5_ctx);
+ req = krb5_auth_send(be_req, be_ctx->ev, be_ctx, pd, krb5_ctx);
if (req == NULL) {
DEBUG(1, ("krb5_auth_send failed.\n"));
goto done;
@@ -1169,8 +1170,7 @@ void krb5_pam_handler(struct be_req *be_req)
tevent_req_set_callback(req, krb5_pam_handler_auth_done, be_req);
break;
case SSS_PAM_ACCT_MGMT:
- req = krb5_access_send(be_req, be_req->be_ctx->ev, be_req->be_ctx,
- pd, krb5_ctx);
+ req = krb5_access_send(be_req, be_ctx->ev, be_ctx, pd, krb5_ctx);
if (req == NULL) {
DEBUG(1, ("krb5_access_send failed.\n"));
goto done;
diff --git a/src/providers/krb5/krb5_wait_queue.c b/src/providers/krb5/krb5_wait_queue.c
index da1e35b7..8b7b9a37 100644
--- a/src/providers/krb5/krb5_wait_queue.c
+++ b/src/providers/krb5/krb5_wait_queue.c
@@ -42,10 +42,10 @@ static void wait_queue_auth(struct tevent_context *ev, struct tevent_timer *te,
struct timeval current_time, void *private_data)
{
struct queue_entry *qe = talloc_get_type(private_data, struct queue_entry);
+ struct be_ctx *be_ctx = be_req_get_be_ctx(qe->be_req);
struct tevent_req *req;
- req = krb5_auth_send(qe->be_req, qe->be_req->be_ctx->ev,
- qe->be_req->be_ctx, qe->pd, qe->krb5_ctx);
+ req = krb5_auth_send(qe->be_req, be_ctx->ev, be_ctx, qe->pd, qe->krb5_ctx);
if (req == NULL) {
DEBUG(1, ("krb5_auth_send failed.\n"));
} else {
@@ -151,6 +151,7 @@ void check_wait_queue(struct krb5_ctx *krb5_ctx, char *username)
struct queue_entry *head;
struct queue_entry *queue_entry;
struct tevent_timer *te;
+ struct be_ctx *be_ctx;
if (krb5_ctx->wait_queue_hash == NULL) {
DEBUG(1, ("No wait queue available.\n"));
@@ -178,7 +179,8 @@ void check_wait_queue(struct krb5_ctx *krb5_ctx, char *username)
DLIST_REMOVE(head, queue_entry);
- te = tevent_add_timer(queue_entry->be_req->be_ctx->ev, krb5_ctx,
+ be_ctx = be_req_get_be_ctx(queue_entry->be_req);
+ te = tevent_add_timer(be_ctx->ev, krb5_ctx,
tevent_timeval_current(), wait_queue_auth,
queue_entry);
if (te == NULL) {