summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/ldap_access.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2013-03-03 18:06:13 -0500
committerJakub Hrozek <jhrozek@redhat.com>2013-03-19 22:49:51 +0100
commitdfd71fc92db940b2892cc996911cec03d7b6c52b (patch)
tree069370fe1a4a61d899f0bc2cb8825bdef9c659d3 /src/providers/ldap/ldap_access.c
parentc0bca1722d6f9dfb654ad78397be70f79ff39af1 (diff)
downloadsssd-dfd71fc92db940b2892cc996911cec03d7b6c52b.tar.gz
sssd-dfd71fc92db940b2892cc996911cec03d7b6c52b.tar.xz
sssd-dfd71fc92db940b2892cc996911cec03d7b6c52b.zip
Convert sdap_access to new error codes
Also simplify sdap_access_send to avoid completely fake _send() routines.
Diffstat (limited to 'src/providers/ldap/ldap_access.c')
-rw-r--r--src/providers/ldap/ldap_access.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/providers/ldap/ldap_access.c b/src/providers/ldap/ldap_access.c
index 5a8e12f05..4a06e66bb 100644
--- a/src/providers/ldap/ldap_access.c
+++ b/src/providers/ldap/ldap_access.c
@@ -69,15 +69,23 @@ void sdap_pam_access_handler(struct be_req *breq)
static void sdap_access_done(struct tevent_req *req)
{
errno_t ret;
- int pam_status = PAM_SYSTEM_ERR;
+ int pam_status;
struct be_req *breq =
tevent_req_callback_data(req, struct be_req);
- ret = sdap_access_recv(req, &pam_status);
+ ret = sdap_access_recv(req);
talloc_zfree(req);
- if (ret != EOK) {
+ switch (ret) {
+ case EOK:
+ pam_status = PAM_SUCCESS;
+ break;
+ case ERR_ACCESS_DENIED:
+ pam_status = PAM_PERM_DENIED;
+ break;
+ default:
DEBUG(SSSDBG_CRIT_FAILURE, ("Error retrieving access check result.\n"));
pam_status = PAM_SYSTEM_ERR;
+ break;
}
sdap_access_reply(breq, pam_status);