1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

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>
This commit is contained in:
Matthias Dieter Wallnöfer 2012-04-11 21:09:38 +02:00 committed by Andrew Tridgell
parent 9deb650fa2
commit 27bcf7a0b6

View File

@ -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) {