From b7b50b21d2254a079b1b1c299909483d23db1512 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Fri, 3 Feb 2012 13:57:00 +0100 Subject: Remove sysdb_get_ctx_from_list() --- src/responder/pam/pam_LOCAL_domain.c | 7 +++---- src/responder/pam/pamsrv_cmd.c | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 16 deletions(-) (limited to 'src/responder/pam') diff --git a/src/responder/pam/pam_LOCAL_domain.c b/src/responder/pam/pam_LOCAL_domain.c index baf8cc663..71446b4f8 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 841bbf439..3efa696ac 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; -- cgit