summaryrefslogtreecommitdiff
path: root/src/providers/ad
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-01-11 12:25:53 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-01-21 22:17:34 +0100
commit8e5549e453558d4bebdec333a93e215d5d6ffaec (patch)
treea9004b07b800492ecb8bdaeb2019512c3fccb229 /src/providers/ad
parentccc2af010bbbe6d8a7496fb717216135bc4c1993 (diff)
downloadsssd-8e5549e453558d4bebdec333a93e215d5d6ffaec.tar.gz
sssd-8e5549e453558d4bebdec333a93e215d5d6ffaec.tar.bz2
sssd-8e5549e453558d4bebdec333a93e215d5d6ffaec.zip
Introduce be_req_terminate() helper
Call it everywhere instead of directly dereferencing be_req->fn This is in preparation of making be_req opaque.
Diffstat (limited to 'src/providers/ad')
-rw-r--r--src/providers/ad/ad_access.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/providers/ad/ad_access.c b/src/providers/ad/ad_access.c
index ec086d4e..66eb4eaa 100644
--- a/src/providers/ad/ad_access.c
+++ b/src/providers/ad/ad_access.c
@@ -47,7 +47,7 @@ ad_access_handler(struct be_req *breq)
pd->domain, NULL, NULL);
if (domain == NULL) {
DEBUG(SSSDBG_OP_FAILURE, ("new_subdomain failed.\n"));
- breq->fn(breq, DP_ERR_FATAL, PAM_SYSTEM_ERR, NULL);
+ be_req_terminate(breq, DP_ERR_FATAL, PAM_SYSTEM_ERR, NULL);
return;
}
} else {
@@ -61,7 +61,7 @@ ad_access_handler(struct be_req *breq)
access_ctx->sdap_access_ctx,
pd);
if (!req) {
- breq->fn(breq, DP_ERR_FATAL, PAM_SYSTEM_ERR, NULL);
+ be_req_terminate(breq, DP_ERR_FATAL, PAM_SYSTEM_ERR, NULL);
return;
}
tevent_req_set_callback(req, ad_access_done, breq);
@@ -79,7 +79,7 @@ ad_access_done(struct tevent_req *req)
ret = sdap_access_recv(req, &pam_status);
talloc_zfree(req);
if (ret != EOK) {
- breq->fn(breq, DP_ERR_FATAL, PAM_SYSTEM_ERR, strerror(ret));
+ be_req_terminate(breq, DP_ERR_FATAL, PAM_SYSTEM_ERR, strerror(ret));
return;
}
@@ -87,12 +87,13 @@ ad_access_done(struct tevent_req *req)
if (pam_status == PAM_SUCCESS || pam_status == PAM_PERM_DENIED) {
/* We got the proper approval or denial */
- breq->fn(breq, DP_ERR_OK, pam_status, NULL);
+ be_req_terminate(breq, DP_ERR_OK, pam_status, NULL);
return;
}
/* Something went wrong */
pd->pam_status = PAM_SYSTEM_ERR;
- breq->fn(breq, DP_ERR_FATAL, pam_status, pam_strerror(NULL, pam_status));
+ be_req_terminate(breq, DP_ERR_FATAL, pam_status,
+ pam_strerror(NULL, pam_status));
return;
}