summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2012-04-11 21:09:38 +0200
committerAndrew Tridgell <tridge@samba.org>2012-04-18 07:48:05 +0200
commit27bcf7a0b6ab3a4c74129e3952c1bf14b8017b86 (patch)
tree8b2445896872962a9f9a77c83f1103ecf08a0b74 /lib
parent9deb650fa2b93338ca91ccc96a940d670d29cbee (diff)
downloadsamba-27bcf7a0b6ab3a4c74129e3952c1bf14b8017b86.tar.gz
samba-27bcf7a0b6ab3a4c74129e3952c1bf14b8017b86.tar.bz2
samba-27bcf7a0b6ab3a4c74129e3952c1bf14b8017b86.zip
LDB:ldb_tdb/ldb_tdb.c - allow LDB modify replaces with different value ordering
This is essential for fixing up wrong ordered "objectClass" attributes. Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/ldb_tdb/ldb_tdb.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index ebde8a34f9..5324c9b76f 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -845,11 +845,18 @@ int ltdb_modify_internal(struct ldb_module *module,
if (idx != -1) {
j = (unsigned int) idx;
el2 = &(msg2->elements[j]);
- if (ldb_msg_element_compare(el, el2) == 0) {
- /* we are replacing with the same values */
+
+ /* we consider two elements to be
+ * equal only if the order
+ * matches. This allows dbcheck to
+ * fix the ordering on attributes
+ * where order matters, such as
+ * objectClass
+ */
+ if (ldb_msg_element_equal_ordered(el, el2)) {
continue;
}
-
+
/* Delete the attribute if it exists in the DB */
if (msg_delete_attribute(module, ldb, msg2,
el->name) != 0) {