summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-02-22 01:31:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:59 -0500
commit00fe70e5b917769418f68eaa255d3a06a9a08ce7 (patch)
tree7fe1d0d71e1771a3365a5dfda3ec4058b1bb2de1 /source4/lib/ldb/tools
parentf490434c0f1f8e63de478c6d65f264277257968a (diff)
downloadsamba-00fe70e5b917769418f68eaa255d3a06a9a08ce7.tar.gz
samba-00fe70e5b917769418f68eaa255d3a06a9a08ce7.tar.bz2
samba-00fe70e5b917769418f68eaa255d3a06a9a08ce7.zip
r13609: Get in the initial work on making ldb async
Currently only ldb_ildap is async, the plan is to first make all backend support the async calls, and then remove the sync functions from backends and keep the only in the API. Modules will need to be transformed along the way. Simo (This used to be commit 1e2c13b2d52de7c534493dd79a2c0596a3e8c1f5)
Diffstat (limited to 'source4/lib/ldb/tools')
-rw-r--r--source4/lib/ldb/tools/cmdline.c4
-rw-r--r--source4/lib/ldb/tools/ldbsearch.c12
2 files changed, 10 insertions, 6 deletions
diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c
index 24005c450c..a67c41e67f 100644
--- a/source4/lib/ldb/tools/cmdline.c
+++ b/source4/lib/ldb/tools/cmdline.c
@@ -596,10 +596,6 @@ int handle_controls_reply(struct ldb_control **reply, struct ldb_control **reque
cookie = ldb_base64_encode(req_control, rep_control->cookie, rep_control->cookie_len);
printf("# DIRSYNC cookie returned was:\n# %s\n", cookie);
- sleep(120);
-
- ret = 1;
-
continue;
}
diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c
index b4120c0dce..c380862c5d 100644
--- a/source4/lib/ldb/tools/ldbsearch.c
+++ b/source4/lib/ldb/tools/ldbsearch.c
@@ -64,9 +64,10 @@ static int do_search(struct ldb_context *ldb,
const char *expression,
const char * const *attrs)
{
- int ret, i;
+ int ret, i, n;
int loop = 0;
int total = 0;
+ int refs = 0;
struct ldb_request req;
struct ldb_result *result = NULL;
@@ -94,7 +95,6 @@ static int do_search(struct ldb_context *ldb,
}
result = req.op.search.res;
- printf("# returned %d records\n", result->count);
if (options->sorted) {
ldb_qsort(result->msgs, result->count, sizeof(struct ldb_message *),
@@ -120,6 +120,12 @@ static int do_search(struct ldb_context *ldb,
ldb_ldif_write_file(ldb, stdout, &ldif);
}
+ if (result->refs) {
+ for(n = 0;result->refs[n]; n++, refs++) {
+ printf("# referral %d\nref: %s\n\n", refs + 1, result->refs[n]);
+ }
+ }
+
if (result->controls) {
if (handle_controls_reply(result->controls, req.controls) == 1)
loop = 1;
@@ -137,6 +143,8 @@ static int do_search(struct ldb_context *ldb,
} while(loop);
+ printf("# returned %d records\n# %d entries\n# %d referrals\n", total + refs, total, refs);
+
return 0;
}