summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamenim@samba.org>2010-12-18 05:30:08 +0200
committerKamen Mazdrashki <kamenim@samba.org>2010-12-18 05:53:48 +0100
commit7157221da5bc6787b08ab26c9e83c08208b41d8a (patch)
tree7a3ecad3a725fa94a576383695c6605e89a535be
parent5bc0848fc73f96879fdb5d398272ead7fee39157 (diff)
downloadsamba-7157221da5bc6787b08ab26c9e83c08208b41d8a.tar.gz
samba-7157221da5bc6787b08ab26c9e83c08208b41d8a.tar.bz2
samba-7157221da5bc6787b08ab26c9e83c08208b41d8a.zip
s4-drepl: During Schema replication, we need to save updated prefixMap if everything is OK
Autobuild-User: Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date: Sat Dec 18 05:53:48 CET 2010 on sn-devel-104
-rw-r--r--source4/dsdb/repl/replicated_objects.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c
index 5997073a8a..0def815c5f 100644
--- a/source4/dsdb/repl/replicated_objects.c
+++ b/source4/dsdb/repl/replicated_objects.c
@@ -445,6 +445,7 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context *ldb,
struct dsdb_extended_replicated_objects *objects,
uint64_t *notify_uSN)
{
+ WERROR werr;
struct ldb_result *ext_res;
struct dsdb_schema *cur_schema = NULL;
int ret;
@@ -503,6 +504,23 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context *ldb,
}
talloc_free(ext_res);
+ /* Save our updated prefixMap */
+ if (working_schema) {
+ werr = dsdb_write_prefixes_from_schema_to_ldb(working_schema,
+ ldb,
+ working_schema);
+ if (!W_ERROR_IS_OK(werr)) {
+ /* restore previous schema */
+ if (cur_schema ) {
+ dsdb_reference_schema(ldb, cur_schema, false);
+ dsdb_make_schema_global(ldb, cur_schema);
+ }
+ DEBUG(0,("Failed to save updated prefixMap: %s\n",
+ win_errstr(werr)));
+ return werr;
+ }
+ }
+
ret = ldb_transaction_prepare_commit(ldb);
if (ret != LDB_SUCCESS) {
/* restore previous schema */