From 7157221da5bc6787b08ab26c9e83c08208b41d8a Mon Sep 17 00:00:00 2001 From: Kamen Mazdrashki Date: Sat, 18 Dec 2010 05:30:08 +0200 Subject: s4-drepl: During Schema replication, we need to save updated prefixMap if everything is OK Autobuild-User: Kamen Mazdrashki Autobuild-Date: Sat Dec 18 05:53:48 CET 2010 on sn-devel-104 --- source4/dsdb/repl/replicated_objects.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source4') 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 */ -- cgit