summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools/ldbsearch.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-04-03 12:29:21 +0000
committerAndrew Tridgell <tridge@samba.org>2004-04-03 12:29:21 +0000
commitee44733f94864fb0a1ae15d48e3335c0705a82ae (patch)
tree8f9691975aab7a6ce3736e64283e66a69db3c194 /source4/lib/ldb/tools/ldbsearch.c
parentf1c3fa060efcecde404d0bfb55c359ef7fe36ed8 (diff)
downloadsamba-ee44733f94864fb0a1ae15d48e3335c0705a82ae.tar.gz
samba-ee44733f94864fb0a1ae15d48e3335c0705a82ae.tar.bz2
samba-ee44733f94864fb0a1ae15d48e3335c0705a82ae.zip
added the rest of the ldb_modify() code, which required a fairly large
change in the ldb API. The API is now much closer to LDAP. (This used to be commit e9e85c464411c561c5073d262a2e3533fec175ca)
Diffstat (limited to 'source4/lib/ldb/tools/ldbsearch.c')
-rw-r--r--source4/lib/ldb/tools/ldbsearch.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/lib/ldb/tools/ldbsearch.c b/source4/lib/ldb/tools/ldbsearch.c
index d7d3c83162..f4eb8f00db 100644
--- a/source4/lib/ldb/tools/ldbsearch.c
+++ b/source4/lib/ldb/tools/ldbsearch.c
@@ -45,7 +45,7 @@
const char *ldb_url;
const char *basedn = NULL;
int opt;
- enum ldb_scope scope = LDB_SCOPE_DEFAULT;
+ enum ldb_scope scope = LDB_SCOPE_SUBTREE;
ldb_url = getenv("LDB_URL");
if (!ldb_url) {
@@ -98,15 +98,20 @@
ret = ldb_search(ldb, basedn, scope, expression, attrs, &msgs);
if (ret == -1) {
- printf("search failed\n");
+ printf("search failed - %s\n", ldb_errstring(ldb));
exit(1);
}
printf("# returned %d records\n", ret);
for (i=0;i<ret;i++) {
+ struct ldb_ldif ldif;
printf("# record %d\n", i+1);
- ldif_write_file(stdout, msgs[i]);
+
+ ldif.changetype = LDB_CHANGETYPE_NONE;
+ ldif.msg = *msgs[i];
+
+ ldif_write_file(stdout, &ldif);
}
if (ret > 0) {