From e4a6f5c8b8de0429578cd09913f1d41d0a1fd82f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 17 Dec 2009 23:50:41 +1100 Subject: s4-dsdb: handle links with no backlinks in replmd_delete --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 689b24f398..e184181f01 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2038,10 +2038,9 @@ static int replmd_delete_remove_link(struct ldb_module *module, msg->dn = dsdb_dn->dn; - if (sa->linkID & 1) { - target_attr = dsdb_attribute_by_linkID(schema, sa->linkID - 1); - } else { - target_attr = dsdb_attribute_by_linkID(schema, sa->linkID + 1); + target_attr = dsdb_attribute_by_linkID(schema, sa->linkID ^ 1); + if (target_attr == NULL) { + continue; } ret = ldb_msg_add_empty(msg, target_attr->lDAPDisplayName, LDB_FLAG_MOD_DELETE, &el2); -- cgit