summaryrefslogtreecommitdiffstats
path: root/src/responder
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-04-15 09:27:54 -0400
committerStephen Gallagher <sgallagh@redhat.com>2011-04-15 11:36:51 -0400
commitd9aadca8dd6676c8af03c3fbed06b7e89b4f97b1 (patch)
treed2fedd09dbcaffaf1b6cb7be97a85d23df91643d /src/responder
parentf858925bda6c5dbbe178b9abb6e85d8ce53c195f (diff)
downloadsssd-d9aadca8dd6676c8af03c3fbed06b7e89b4f97b1.tar.gz
sssd-d9aadca8dd6676c8af03c3fbed06b7e89b4f97b1.tar.xz
sssd-d9aadca8dd6676c8af03c3fbed06b7e89b4f97b1.zip
Fix regression where nonexistent entries were never added to the negative cache
Diffstat (limited to 'src/responder')
-rw-r--r--src/responder/nss/nsssrv_cmd.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index b897c7cdf..db301b380 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -565,20 +565,20 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx)
}
if (dctx->res->count == 0 && !dctx->check_provider) {
+ /* set negative cache only if not result of cache check */
+ ret = sss_ncache_set_user(nctx->ncache, false, dom->name, name);
+ if (ret != EOK) {
+ return ret;
+ }
+
/* if a multidomain search, try with next */
if (cmdctx->check_next) {
dom = dom->next;
- continue;
+ if (dom) continue;
}
DEBUG(2, ("No results for getpwnam call\n"));
- /* set negative cache only if not result of cache check */
- ret = sss_ncache_set_user(nctx->ncache, false, dom->name, name);
- if (ret != EOK) {
- return ret;
- }
-
return ENOENT;
}
@@ -1832,20 +1832,20 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx)
}
if (dctx->res->count == 0 && !dctx->check_provider) {
+ /* set negative cache only if not result of cache check */
+ ret = sss_ncache_set_group(nctx->ncache, false, dom->name, name);
+ if (ret != EOK) {
+ return ret;
+ }
+
/* if a multidomain search, try with next */
if (cmdctx->check_next) {
dom = dom->next;
- continue;
+ if (dom) continue;
}
DEBUG(2, ("No results for getgrnam call\n"));
- /* set negative cache only if not result of cache check */
- ret = sss_ncache_set_group(nctx->ncache, false, dom->name, name);
- if (ret != EOK) {
- return ret;
- }
-
return ENOENT;
}
@@ -2866,20 +2866,20 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx)
}
if (dctx->res->count == 0 && !dctx->check_provider) {
+ /* set negative cache only if not result of cache check */
+ ret = sss_ncache_set_user(nctx->ncache, false, dom->name, name);
+ if (ret != EOK) {
+ return ret;
+ }
+
/* if a multidomain search, try with next */
if (cmdctx->check_next) {
dom = dom->next;
- continue;
+ if (dom) continue;
}
DEBUG(2, ("No results for initgroups call\n"));
- /* set negative cache only if not result of cache check */
- ret = sss_ncache_set_user(nctx->ncache, false, dom->name, name);
- if (ret != EOK) {
- return ret;
- }
-
return ENOENT;
}