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/ldbadd.c1
-rw-r--r--source4/lib/ldb/tools/ldbdel.c1
-rw-r--r--source4/lib/ldb/tools/ldbedit.c1
-rw-r--r--source4/lib/ldb/tools/ldbmodify.c1
-rw-r--r--source4/lib/ldb/tools/ldbrename.c1
-rw-r--r--source4/lib/ldb/tools/ldbsearch.c14
-rw-r--r--source4/lib/ldb/tools/ldbtest.c1
7 files changed, 13 insertions, 7 deletions
diff --git a/source4/lib/ldb/tools/ldbadd.c b/source4/lib/ldb/tools/ldbadd.c
index c22cfde4ec..058f4dc751 100644
--- a/source4/lib/ldb/tools/ldbadd.c
+++ b/source4/lib/ldb/tools/ldbadd.c
@@ -35,6 +35,7 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
+#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbdel.c b/source4/lib/ldb/tools/ldbdel.c
index a6574a5088..6da8d0269f 100644
--- a/source4/lib/ldb/tools/ldbdel.c
+++ b/source4/lib/ldb/tools/ldbdel.c
@@ -35,6 +35,7 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
+#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbedit.c b/source4/lib/ldb/tools/ldbedit.c
index 8818777ceb..4d47cf27c9 100644
--- a/source4/lib/ldb/tools/ldbedit.c
+++ b/source4/lib/ldb/tools/ldbedit.c
@@ -35,6 +35,7 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
+#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbmodify.c b/source4/lib/ldb/tools/ldbmodify.c
index f067aef3f8..4c78e485b5 100644
--- a/source4/lib/ldb/tools/ldbmodify.c
+++ b/source4/lib/ldb/tools/ldbmodify.c
@@ -34,6 +34,7 @@
#include "includes.h"
#include "ldb/include/ldb.h"
+#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbrename.c b/source4/lib/ldb/tools/ldbrename.c
index f225246cc7..4b3b27c130 100644
--- a/source4/lib/ldb/tools/ldbrename.c
+++ b/source4/lib/ldb/tools/ldbrename.c
@@ -36,6 +36,7 @@
#include "includes.h"
#include "ldb/include/ldb.h"
+#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c
index c493356405..a340e16d08 100644
--- a/source4/lib/ldb/tools/ldbsearch.c
+++ b/source4/lib/ldb/tools/ldbsearch.c
@@ -35,6 +35,7 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
+#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_
@@ -55,12 +56,12 @@ static void usage(void)
exit(1);
}
-struct ldb_context *ldbsearch_ldb;
-
static int do_compare_msg(struct ldb_message **el1,
- struct ldb_message **el2)
+ struct ldb_message **el2,
+ void *opaque)
{
- return ldb_dn_compare(ldbsearch_ldb, (*el1)->dn, (*el2)->dn);
+ struct ldb_context *ldb = talloc_get_type(opaque, struct ldb_context);
+ return ldb_dn_compare(ldb, (*el1)->dn, (*el2)->dn);
}
static int do_search(struct ldb_context *ldb,
@@ -81,10 +82,9 @@ static int do_search(struct ldb_context *ldb,
printf("# returned %d records\n", ret);
- ldbsearch_ldb = ldb;
if (sort_attribs) {
- qsort(result->msgs, ret, sizeof(struct ldb_message *),
- (comparison_fn_t)do_compare_msg);
+ ldb_qsort(result->msgs, ret, sizeof(struct ldb_message *),
+ ldb, (ldb_qsort_cmp_fn_t)do_compare_msg);
}
for (i = 0; i < result->count; i++) {
diff --git a/source4/lib/ldb/tools/ldbtest.c b/source4/lib/ldb/tools/ldbtest.c
index f79f5c6b4c..7abc1bfcef 100644
--- a/source4/lib/ldb/tools/ldbtest.c
+++ b/source4/lib/ldb/tools/ldbtest.c
@@ -35,6 +35,7 @@
#include "includes.h"
#include "ldb/include/ldb.h"
#include "ldb/include/ldb_errors.h"
+#include "ldb/include/ldb_private.h"
#include "ldb/tools/cmdline.h"
#ifdef _SAMBA_BUILD_