summaryrefslogtreecommitdiff
path: root/src/responder/pam
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-02-03 13:57:00 +0100
committerStephen Gallagher <sgallagh@redhat.com>2012-02-29 12:53:47 -0500
commitb7b50b21d2254a079b1b1c299909483d23db1512 (patch)
treec2c9b2bff77dfadb9d70d348ad6ffb06c60e8d2b /src/responder/pam
parentd2d2d6ae0c436461bcc8f881df059eb036314c44 (diff)
downloadsssd-b7b50b21d2254a079b1b1c299909483d23db1512.tar.gz
sssd-b7b50b21d2254a079b1b1c299909483d23db1512.tar.bz2
sssd-b7b50b21d2254a079b1b1c299909483d23db1512.zip
Remove sysdb_get_ctx_from_list()
Diffstat (limited to 'src/responder/pam')
-rw-r--r--src/responder/pam/pam_LOCAL_domain.c7
-rw-r--r--src/responder/pam/pamsrv_cmd.c24
2 files changed, 15 insertions, 16 deletions
diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c
index baf8cc66..71446b4f 100644
--- a/src/responder/pam/pam_LOCAL_domain.c
+++ b/src/responder/pam/pam_LOCAL_domain.c
@@ -236,12 +236,11 @@ int LOCAL_pam_handler(struct pam_auth_req *preq)
return ENOMEM;
}
- ret = sysdb_get_ctx_from_list(preq->cctx->rctx->db_list,
- preq->domain, &lreq->dbctx);
- if (ret != EOK) {
+ lreq->dbctx = preq->domain->sysdb;
+ if (lreq->dbctx == NULL) {
DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n"));
talloc_free(lreq);
- return ret;
+ return ENOENT;
}
lreq->ev = preq->cctx->ev;
lreq->preq = preq;
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index 841bbf43..3efa696a 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -331,10 +331,10 @@ static errno_t set_last_login(struct pam_auth_req *preq)
goto fail;
}
- ret = sysdb_get_ctx_from_list(preq->cctx->rctx->db_list, preq->domain,
- &dbctx);
- if (ret != EOK) {
+ dbctx = preq->domain->sysdb;
+ if (dbctx == NULL) {
DEBUG(0, ("Fatal: Sysdb context not found for this domain!\n"));
+ ret = EINVAL;
goto fail;
}
@@ -377,9 +377,11 @@ static errno_t get_selinux_string(struct pam_auth_req *preq)
goto done;
}
- ret = sysdb_get_ctx_from_list(preq->cctx->rctx->db_list,
- preq->domain, &sysdb);
- if (ret != EOK) {
+ sysdb = preq->domain->sysdb;
+ if (sysdb == NULL) {
+ DEBUG(SSSDBG_FATAL_FAILURE, ("Fatal: Sysdb CTX not found for "
+ "domain [%s]!\n", preq->domain->name));
+ ret = EINVAL;
goto done;
}
@@ -655,9 +657,8 @@ static void pam_reply(struct pam_auth_req *preq)
/* do auth with offline credentials */
pd->offline_auth = true;
- ret = sysdb_get_ctx_from_list(preq->cctx->rctx->db_list,
- preq->domain, &sysdb);
- if (ret != EOK) {
+ sysdb = preq->domain->sysdb;
+ if (sysdb == NULL) {
DEBUG(0, ("Fatal: Sysdb CTX not found for "
"domain [%s]!\n", preq->domain->name));
goto done;
@@ -994,7 +995,6 @@ static void pam_dp_send_acct_req_done(struct tevent_req *req);
static int pam_check_user_search(struct pam_auth_req *preq)
{
struct sss_domain_info *dom = preq->domain;
- struct cli_ctx *cctx = preq->cctx;
char *name = NULL;
struct sysdb_ctx *sysdb;
time_t cacheExpire;
@@ -1049,8 +1049,8 @@ static int pam_check_user_search(struct pam_auth_req *preq)
DEBUG(4, ("Requesting info for [%s@%s]\n", name, dom->name));
- ret = sysdb_get_ctx_from_list(cctx->rctx->db_list, dom, &sysdb);
- if (ret != EOK) {
+ sysdb = dom->sysdb;
+ if (sysdb == NULL) {
DEBUG(0, ("Fatal: Sysdb CTX not found for this domain!\n"));
preq->pd->pam_status = PAM_SYSTEM_ERR;
return EFAULT;