summaryrefslogtreecommitdiff
path: root/src/responder/nss
diff options
context:
space:
mode:
Diffstat (limited to 'src/responder/nss')
-rw-r--r--src/responder/nss/nsssrv_cmd.c28
-rw-r--r--src/responder/nss/nsssrv_netgroup.c4
-rw-r--r--src/responder/nss/nsssrv_services.c19
3 files changed, 26 insertions, 25 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 2a2a16b8..1e9927c1 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -715,8 +715,8 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx)
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"));
return EIO;
}
@@ -944,8 +944,8 @@ static int nss_cmd_getpwuid_search(struct nss_dom_ctx *dctx)
DEBUG(4, ("Requesting info for [%d@%s]\n", cmdctx->id, 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"));
return EIO;
}
@@ -1314,8 +1314,8 @@ static errno_t nss_cmd_setpwent_step(struct setent_step_ctx *step_ctx)
DEBUG(6, ("Requesting info for domain [%s]\n", dom->name));
- ret = sysdb_get_ctx_from_list(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"));
return EIO;
}
@@ -2020,8 +2020,8 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx)
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"));
return EIO;
}
@@ -2249,8 +2249,8 @@ static int nss_cmd_getgrgid_search(struct nss_dom_ctx *dctx)
DEBUG(4, ("Requesting info for [%d@%s]\n", cmdctx->id, 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"));
return EIO;
}
@@ -2612,8 +2612,8 @@ static errno_t nss_cmd_setgrent_step(struct setent_step_ctx *step_ctx)
DEBUG(6, ("Requesting info for domain [%s]\n", dom->name));
- ret = sysdb_get_ctx_from_list(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"));
return EIO;
}
@@ -3081,8 +3081,8 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx)
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"));
return EIO;
}
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index 5c79342c..9cb3422f 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -412,8 +412,8 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
DEBUG(4, ("Requesting info for [%s@%s]\n",
name, dom->name));
- ret = sysdb_get_ctx_from_list(step_ctx->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"));
return EIO;
}
diff --git a/src/responder/nss/nsssrv_services.c b/src/responder/nss/nsssrv_services.c
index 872b0701..a3ac8576 100644
--- a/src/responder/nss/nsssrv_services.c
+++ b/src/responder/nss/nsssrv_services.c
@@ -164,8 +164,8 @@ getserv_send(TALLOC_CTX *mem_ctx,
}
if (!dom) break;
- ret = sysdb_get_ctx_from_list(cctx->rctx->db_list, dom, &sysdb);
- if (ret != EOK) {
+ sysdb = dom->sysdb;
+ if (sysdb == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE,
("Critical: Sysdb CTX not found for [%s]!\n", dom->name));
ret = EINVAL;
@@ -479,9 +479,8 @@ static void lookup_service_done(struct tevent_req *subreq)
* be returned, if it exists. Otherwise, move to the
* next provider.
*/
- ret = sysdb_get_ctx_from_list(cctx->rctx->db_list,
- dom, &sysdb);
- if (ret != EOK) {
+ sysdb = dom->sysdb;
+ if (sysdb == NULL) {
DEBUG(SSSDBG_CRIT_FAILURE,
("Critical: Sysdb CTX not found for [%s]!\n",
dom->name));
@@ -1370,10 +1369,11 @@ lookup_servent_send(TALLOC_CTX *mem_ctx,
/* No provider check required. Just ask the
* sysdb.
*/
- ret = sysdb_get_ctx_from_list(rctx->db_list, dom, &sysdb);
- if (ret != EOK) {
+ sysdb = dom->sysdb;
+ if (sysdb == NULL) {
DEBUG(SSSDBG_FATAL_FAILURE,
("Sysdb CTX not found for [%s]!\n", dom->name));
+ ret = EINVAL;
goto immediate;
}
@@ -1431,10 +1431,11 @@ lookup_servent_done(struct tevent_req *subreq)
}
/* Check the cache now */
- ret = sysdb_get_ctx_from_list(state->rctx->db_list, state->dom, &sysdb);
- if (ret != EOK) {
+ sysdb = state->dom->sysdb;
+ if (sysdb == NULL) {
DEBUG(SSSDBG_FATAL_FAILURE,
("Sysdb CTX not found for [%s]!\n", state->dom->name));
+ ret = EINVAL;
goto done;
}