From 09c1b9cbe5175636bcf4b606edfd0022bd9cfd6b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 31 Dec 2004 03:51:42 +0000 Subject: 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) --- source4/lib/ldb/tools/ldbedit.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source4/lib/ldb/tools/ldbedit.c') 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;inum_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); } -- cgit