summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-09-17 15:31:04 -0700
committerAndrew Bartlett <abartlet@samba.org>2013-09-19 12:28:04 -0700
commitaa07b5caf9ac13fc517c4c9d21f16ebff5415544 (patch)
tree20c8b03be0270fb1d4c0d1c09cabb35183d39d58 /source4/dsdb
parentc42db8975f8f84ce576c97ad95ca59ba5170d596 (diff)
downloadsamba-aa07b5caf9ac13fc517c4c9d21f16ebff5415544.tar.gz
samba-aa07b5caf9ac13fc517c4c9d21f16ebff5415544.tar.bz2
samba-aa07b5caf9ac13fc517c4c9d21f16ebff5415544.zip
dsdb-repl_meta_data: Make handling of Deleted Objects DN clearer in delete
This code no longer needs to handle not renaming Deleted Objects during a re-delete, because it is no longer called in that case. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index e562e2467f..91a5d9233c 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -3001,14 +3001,17 @@ static int replmd_delete_internals(struct ldb_module *module, struct ldb_request
/* work out where we will be renaming this object to */
if (!disallow_move_on_delete) {
+ struct ldb_dn *deleted_objects_dn;
ret = dsdb_get_deleted_objects_dn(ldb, tmp_ctx, old_dn,
- &new_dn);
+ &deleted_objects_dn);
+
/*
- * Deleted Objects itself appears to be deleted, but
- * should also not be moved, and we should not move
- * objects if we can't find the deleted objects DN
+ * We should not move objects if we can't find the
+ * deleted objects DN. Not moving (or otherwise
+ * harming) the Deleted Objects DN itself is handled
+ * in the caller.
*/
- if (re_delete && (ret != LDB_SUCCESS || ldb_dn_compare(old_dn, new_dn) == 0)) {
+ if (re_delete && (ret != LDB_SUCCESS)) {
new_dn = ldb_dn_get_parent(tmp_ctx, old_dn);
if (new_dn == NULL) {
ldb_module_oom(module);
@@ -3023,6 +3026,8 @@ static int replmd_delete_internals(struct ldb_module *module, struct ldb_request
ldb_dn_get_linearized(old_dn));
talloc_free(tmp_ctx);
return LDB_ERR_UNWILLING_TO_PERFORM;
+ } else {
+ new_dn = deleted_objects_dn;
}
} else {
new_dn = ldb_dn_get_parent(tmp_ctx, old_dn);