summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/ldb/tools')
-rw-r--r--source4/lib/ldb/tools/ldbsearch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c
index 6bbd9e2f74..f151164559 100644
--- a/source4/lib/ldb/tools/ldbsearch.c
+++ b/source4/lib/ldb/tools/ldbsearch.c
@@ -218,6 +218,10 @@ static int do_search(struct ldb_context *ldb,
sctx->entries = 0;
sctx->refs = 0;
+ if (basedn == NULL) {
+ basedn = ldb_auto_basedn(ldb);
+ }
+
req->operation = LDB_SEARCH;
req->op.search.base = basedn;
req->op.search.scope = options->scope;