From 4beff4d7ba6709009ad81e3becb691b9d81e5611 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 1 Oct 2010 10:24:46 -0700 Subject: s4-dsdb: fail the transaction instead of asserting on error It is more useful to fail the transaction and give the user an error message than to assert when we have an error in the repl_meta_data module Pair-Programmed-With: Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules/repl_meta_data.c') diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index ebd005e46e..17dcba5929 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2981,9 +2981,17 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar) md_remote = replmd_replPropertyMetaData1_find_attid(rmd, DRSUAPI_ATTRIBUTE_name); if (md_remote) { md_local = replmd_replPropertyMetaData1_find_attid(&omd, DRSUAPI_ATTRIBUTE_name); - SMB_ASSERT(md_local); + if (!md_local) { + DEBUG(0,(__location__ ": No md_local in RPMD\n")); + return replmd_replicated_request_werror(ar, WERR_DS_DRA_INTERNAL_ERROR); + } if (replmd_replPropertyMetaData1_is_newer(md_local, md_remote)) { - SMB_ASSERT(ldb_dn_compare(msg->dn, ar->search_msg->dn) != 0); + if (ldb_dn_compare(msg->dn, ar->search_msg->dn) != 0) { + DEBUG(0,(__location__ ": DNs don't match in RPMD: %s %s\n", + ldb_dn_get_linearized(msg->dn), + ldb_dn_get_linearized(ar->search_msg->dn))); + return replmd_replicated_request_werror(ar, WERR_DS_DRA_INTERNAL_ERROR); + } /* TODO: Find appropriate local name (dn) for the object * and modify msg->dn appropriately */ -- cgit