summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/responder/nss/nsssrv_netgroup.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index 1c9b72ae3..86cb8cd4d 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -514,32 +514,30 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
/* Look up the netgroup in the cache */
ret = sysdb_getnetgr(step_ctx->dctx, dom, name, &step_ctx->dctx->res);
- if (ret == ENOENT) {
+ if (ret == EOK) {
+ if (step_ctx->dctx->res->count > 1) {
+ DEBUG(SSSDBG_FATAL_FAILURE,
+ "getnetgr call returned more than one result !?!\n");
+ ret = EMSGSIZE;
+ goto done;
+ }
+ } else if (ret == ENOENT) {
/* This netgroup was not found in this domain */
if (!step_ctx->dctx->check_provider) {
if (step_ctx->check_next) {
dom = get_next_domain(dom, false);
continue;
+ } else {
+ break;
}
- else break;
}
- ret = EOK;
- }
-
- if (ret != EOK) {
+ } else {
DEBUG(SSSDBG_CRIT_FAILURE,
"Failed to make request to our cache!\n");
ret = EIO;
goto done;
}
- if (step_ctx->dctx->res->count > 1) {
- DEBUG(SSSDBG_FATAL_FAILURE,
- "getnetgr call returned more than one result !?!\n");
- ret = EMSGSIZE;
- goto done;
- }
-
ret = get_netgroup_entry(step_ctx->nctx, step_ctx->name,
&netgr);
if (ret != EOK) {