summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-07-29 15:03:21 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-07-29 22:55:33 +1000
commit54b83ce9b7bb70e26f8c83bc0ed7fcf5b8985399 (patch)
tree6e503c70a1481fc711f840c88f2d626d88fc690a /source4/dsdb/samdb
parent056b2151568979fa688654920d1d19b7b9c810d2 (diff)
downloadsamba-54b83ce9b7bb70e26f8c83bc0ed7fcf5b8985399.tar.gz
samba-54b83ce9b7bb70e26f8c83bc0ed7fcf5b8985399.tar.bz2
samba-54b83ce9b7bb70e26f8c83bc0ed7fcf5b8985399.zip
s4-dsdb: Do not strip base components off DN before searching for NC root
Diffstat (limited to 'source4/dsdb/samdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index b9e1852f3b..41292115bb 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -3737,13 +3737,8 @@ static int replmd_replicated_apply_search_for_parent_callback(struct ldb_request
struct ldb_message *parent_msg = ares->message;
struct ldb_message *msg = ar->objs->objects[ar->index_current].msg;
struct ldb_dn *parent_dn;
- int comp_num = ldb_dn_get_comp_num(msg->dn);
- if (comp_num > 1) {
- if (!ldb_dn_remove_base_components(msg->dn, comp_num - 1)) {
- talloc_free(ares);
- return ldb_module_done(ar->req, NULL, NULL, ldb_module_operr(ar->module));
- }
- }
+ int comp_num;
+
if (!ldb_msg_check_string_attribute(msg, "isDeleted", "TRUE")
&& ldb_msg_check_string_attribute(parent_msg, "isDeleted", "TRUE")) {
/* Per MS-DRSR 4.1.10.6.10
@@ -3790,6 +3785,14 @@ static int replmd_replicated_apply_search_for_parent_callback(struct ldb_request
} else {
parent_dn = parent_msg->dn;
}
+
+ comp_num = ldb_dn_get_comp_num(msg->dn);
+ if (comp_num > 1) {
+ if (!ldb_dn_remove_base_components(msg->dn, comp_num - 1)) {
+ talloc_free(ares);
+ return ldb_module_done(ar->req, NULL, NULL, ldb_module_operr(ar->module));
+ }
+ }
if (!ldb_dn_add_base(msg->dn, parent_dn)) {
talloc_free(ares);
return ldb_module_done(ar->req, NULL, NULL, ldb_module_operr(ar->module));