summaryrefslogtreecommitdiffstats
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:59 -0400
commit342a8ce31f7acab6793cc53984976dee7182207a (patch)
treeddc8d2591e20a871251d9928ad8c557b1deb858c
parentd999fd357fd7df16a85fa21fd6e05e54c60ec1cd (diff)
downloadsssd-342a8ce31f7acab6793cc53984976dee7182207a.tar.gz
sssd-342a8ce31f7acab6793cc53984976dee7182207a.tar.xz
sssd-342a8ce31f7acab6793cc53984976dee7182207a.zip
Fix regression where nonexistent entries were never added to the negative cache
-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;
}