diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2013-06-25 09:01:45 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-06-27 20:51:28 +0200 |
commit | f2022f7ba55973ae8b8baf2d4307322a180357b9 (patch) | |
tree | 401f96ac4a127239bc1bfe0997b67cd32a639160 /src/responder/nss | |
parent | 374c4f45cc8823a7bd7de12528b74dd860541d6c (diff) | |
download | sssd-f2022f7ba55973ae8b8baf2d4307322a180357b9.tar.gz sssd-f2022f7ba55973ae8b8baf2d4307322a180357b9.tar.bz2 sssd-f2022f7ba55973ae8b8baf2d4307322a180357b9.zip |
Handle too many results from getnetgr.
Diffstat (limited to 'src/responder/nss')
-rw-r--r-- | src/responder/nss/nsssrv_netgroup.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c index 4ec4161c..12be52bf 100644 --- a/src/responder/nss/nsssrv_netgroup.c +++ b/src/responder/nss/nsssrv_netgroup.c @@ -363,7 +363,14 @@ static errno_t setnetgrent_retry(struct tevent_req *req) } ret = lookup_netgr_step(step_ctx); - if (ret != EOK) { + switch (ret) { + case EOK: + break; + case EMSGSIZE: + state->netgr->ready = true; + ret = ENOENT; + /* FALLTHROUGH */ + default: goto done; } tevent_req_done(req); @@ -459,6 +466,11 @@ 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, sysdb, dom, name, &step_ctx->dctx->res); + if (step_ctx->dctx->res->count > 1) { + DEBUG(SSSDBG_FATAL_FAILURE, + ("getnetgr call returned more than one result !?!\n")); + return EMSGSIZE; + } if (ret == ENOENT) { /* This netgroup was not found in this domain */ if (!step_ctx->dctx->check_provider) { |