summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2011-01-07 12:03:04 -0500
committerStephen Gallagher <sgallagh@redhat.com>2011-01-14 08:58:16 -0500
commit337d3d9ba9e271272046feac0d17911d024eb43f (patch)
tree5b272ba17ddca0e0fddc7c36cd8d5096c0b88a38 /src
parent86aa3e41afb1b47b59ddfbd52b84b977bb1bb2f8 (diff)
downloadsssd-337d3d9ba9e271272046feac0d17911d024eb43f.tar.gz
sssd-337d3d9ba9e271272046feac0d17911d024eb43f.tar.xz
sssd-337d3d9ba9e271272046feac0d17911d024eb43f.zip
Work around libldb bug
Libldb performs non-indexed searches for ONELEVEL requests. We'll use SUBTREE instead to reduce the performance hit substantially
Diffstat (limited to 'src')
-rw-r--r--src/db/sysdb_ops.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 19f43c6c..23264b41 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -265,7 +265,11 @@ int sysdb_search_user_by_uid(TALLOC_CTX *mem_ctx,
goto done;
}
- ret = sysdb_search_entry(tmpctx, ctx, basedn, LDB_SCOPE_ONELEVEL, filter,
+ /* Use SUBTREE scope here, not ONELEVEL
+ * There is a bug in LDB that makes ONELEVEL searches extremely
+ * slow (it ignores indexing)
+ */
+ ret = sysdb_search_entry(tmpctx, ctx, basedn, LDB_SCOPE_SUBTREE, filter,
attrs?attrs:def_attrs, &msgs_count, &msgs);
if (ret) {
goto done;
@@ -359,7 +363,11 @@ int sysdb_search_group_by_gid(TALLOC_CTX *mem_ctx,
goto done;
}
- ret = sysdb_search_entry(tmpctx, ctx, basedn, LDB_SCOPE_ONELEVEL, filter,
+ /* Use SUBTREE scope here, not ONELEVEL
+ * There is a bug in LDB that makes ONELEVEL searches extremely
+ * slow (it ignores indexing)
+ */
+ ret = sysdb_search_entry(tmpctx, ctx, basedn, LDB_SCOPE_SUBTREE, filter,
attrs?attrs:def_attrs, &msgs_count, &msgs);
if (ret) {
goto done;