summaryrefslogtreecommitdiffstats
path: root/src/responder/common
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-05-18 14:30:28 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-06-23 13:40:11 +0200
commitdd285415d7a8d8376207960cfa3e977524c3b98c (patch)
tree38d848dcdc43045ef5d781665b0a28bf85bffd7b /src/responder/common
parent13d7df10bf4d76c333a9169f9fcbeb891d870351 (diff)
downloadsssd-dd285415d7a8d8376207960cfa3e977524c3b98c.tar.gz
sssd-dd285415d7a8d8376207960cfa3e977524c3b98c.tar.xz
sssd-dd285415d7a8d8376207960cfa3e977524c3b98c.zip
SYSDB: Search the timestamp caches in addition to the sysdb cache
When a sysdb entry is searched, the sysdb cache is consulted first for users or groups. If an entry is found in the sysdb cache, the attributes from the timestamp cache are merged to return the full and up-to-date set of attributes. The merging is done with a single BASE search which is a direct lookup into the underlying key-value database, so it should be relatively fast. More complex merging is done only for enumeration by filter which is currently done only via the IFP back end and should be quite infrequent, so I hope we can justify a more complex merging there. Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/responder/common')
-rw-r--r--src/responder/common/responder_cache_req.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/responder/common/responder_cache_req.c b/src/responder/common/responder_cache_req.c
index a8f846c96..c1f67cd90 100644
--- a/src/responder/common/responder_cache_req.c
+++ b/src/responder/common/responder_cache_req.c
@@ -43,11 +43,14 @@ static errno_t updated_users_by_filter(TALLOC_CTX *mem_ctx,
recent_filter = talloc_asprintf(mem_ctx, "(%s>=%lu)",
SYSDB_LAST_UPDATE, since);
+ if (recent_filter == NULL) {
+ return ENOMEM;
+ }
+
ret = sysdb_enumpwent_filter_with_views(mem_ctx, domain,
name_filter, recent_filter,
_res);
talloc_free(recent_filter);
-
return ret;
}
@@ -62,11 +65,14 @@ static errno_t updated_groups_by_filter(TALLOC_CTX *mem_ctx,
recent_filter = talloc_asprintf(mem_ctx, "(%s>=%lu)",
SYSDB_LAST_UPDATE, since);
+ if (recent_filter == NULL) {
+ return ENOMEM;
+ }
+
ret = sysdb_enumgrent_filter_with_views(mem_ctx, domain,
name_filter, recent_filter,
_res);
talloc_free(recent_filter);
-
return ret;
}