summaryrefslogtreecommitdiffstats
path: root/src/db/sysdb_ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/db/sysdb_ops.c')
-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;