summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/tools
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-12-31 03:51:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:48 -0500
commit09c1b9cbe5175636bcf4b606edfd0022bd9cfd6b (patch)
treedaa546fe5df745feb36663f93dafdb0339aee495 /source4/lib/ldb/tools
parent72ffef24060a36071ce26ff0c39dcf44d74c6551 (diff)
downloadsamba-09c1b9cbe5175636bcf4b606edfd0022bd9cfd6b.tar.gz
samba-09c1b9cbe5175636bcf4b606edfd0022bd9cfd6b.tar.bz2
samba-09c1b9cbe5175636bcf4b606edfd0022bd9cfd6b.zip
r4427: - added ldb_msg_*() functions for sorting, comparing and copying messages
- added a ldb_msg_canonicalize() function that fixes a record to not have any duplicate elements - changed ldbedit to use ldb_msg_canonicalize(). This fixes a bug when you rename multiple elements in a record in one edit (This used to be commit f006e724400843419c8b6155cbeae1876983855e)
Diffstat (limited to 'source4/lib/ldb/tools')
-rw-r--r--source4/lib/ldb/tools/ldbedit.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/lib/ldb/tools/ldbedit.c b/source4/lib/ldb/tools/ldbedit.c
index f84d05440f..6cd6ef041b 100644
--- a/source4/lib/ldb/tools/ldbedit.c
+++ b/source4/lib/ldb/tools/ldbedit.c
@@ -69,6 +69,12 @@ static int modify_record(struct ldb_context *ldb,
mod.num_elements = 0;
mod.elements = NULL;
+ msg2 = ldb_msg_canonicalize(ldb, msg2);
+ if (msg2 == NULL) {
+ fprintf(stderr, "Failed to canonicalise msg2\n");
+ return -1;
+ }
+
/* look in msg2 to find elements that need to be added
or modified */
for (i=0;i<msg2->num_elements;i++) {
@@ -295,6 +301,7 @@ static void usage(void)
printf(" -b basedn choose baseDN\n");
printf(" -a edit all records (expression 'objectclass=*')\n");
printf(" -e editor choose editor (or $VISUAL or $EDITOR)\n");
+ printf(" -v verbose mode)\n");
exit(1);
}