summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-12-17 23:00:16 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-02 08:16:49 +1100
commite9699e9cb9c2a5dc43a85c3d1565e12e0e299038 (patch)
tree4f3f2af34cd445f0fe05e08de055e0bdc7ff7648 /source4
parent2b5cd3dba29043281a6ca04398623a7f1972d71b (diff)
downloadsamba-e9699e9cb9c2a5dc43a85c3d1565e12e0e299038.tar.gz
samba-e9699e9cb9c2a5dc43a85c3d1565e12e0e299038.tar.bz2
samba-e9699e9cb9c2a5dc43a85c3d1565e12e0e299038.zip
s4-dsdb: do the rename after the modify in replmd_delete
This makes updating the links a bit easier
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 3390f80f13..689b24f398 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -617,7 +617,7 @@ static int replmd_add_fix_la(struct ldb_module *module, struct ldb_message_eleme
return LDB_ERR_OPERATIONS_ERROR;
}
- ret = replmd_add_backlink(module, schema, guid, &target_guid, true, sa, true);
+ ret = replmd_add_backlink(module, schema, guid, &target_guid, true, sa, false);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;
@@ -2145,16 +2145,6 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
- /* New DN name generated, renaming the original DN */
- ret = dsdb_module_rename(module, old_dn, new_dn, 0);
- if (ret != LDB_SUCCESS){
- DEBUG(0,(__location__ ": Failed to rename object from '%s' to '%s'\n",
- ldb_dn_get_linearized(old_dn),
- ldb_dn_get_linearized(new_dn)));
- talloc_free(tmp_ctx);
- return ret;
- }
-
/*
now we need to modify the object in the following ways:
@@ -2179,7 +2169,7 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req)
return LDB_ERR_OPERATIONS_ERROR;
}
- msg->dn = new_dn;
+ msg->dn = old_dn;
ret = ldb_msg_add_string(msg, "isDeleted", "TRUE");
if (ret != LDB_SUCCESS) {
@@ -2271,6 +2261,17 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req)
return ret;
}
+ /* now rename onto the new DN */
+ ret = dsdb_module_rename(module, old_dn, new_dn, 0);
+ if (ret != LDB_SUCCESS){
+ DEBUG(0,(__location__ ": Failed to rename object from '%s' to '%s' - %s\n",
+ ldb_dn_get_linearized(old_dn),
+ ldb_dn_get_linearized(new_dn),
+ ldb_errstring(ldb)));
+ talloc_free(tmp_ctx);
+ return ret;
+ }
+
talloc_free(tmp_ctx);
return ldb_module_done(req, NULL, NULL, LDB_SUCCESS);