[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Wed Oct 5 19:44:02 MDT 2011
The branch, master has been updated
via e717af0 s4-dsdb: Do not assume that all deleted objects have an objectCategory and sAMAccountType
via f55328a dsdb: Do not attempt to resolve conflicts on an RODC
via 5505418 dsdb: fix double-free in replication failure case on RODC
via 5c5d869 s4-dsdb Allow repl server to start even when no master NCs are present
from 2d6571d Add missing com_err dependencies Signed-off-by: Jelmer Vernooij <jelmer at samba.org>
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit e717af030146db7bc298a581b030cb7535614e0f
Author: Andrew Bartlett <abartlet at samba.org>
Date: Fri Sep 30 14:33:38 2011 -0700
s4-dsdb: Do not assume that all deleted objects have an objectCategory and sAMAccountType
Autobuild-User: Andrew Bartlett <abartlet at samba.org>
Autobuild-Date: Thu Oct 6 03:43:13 CEST 2011 on sn-devel-104
commit f55328a295b4fb11bea8efc8888d73e3573deb21
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Sep 29 18:56:38 2011 -0700
dsdb: Do not attempt to resolve conflicts on an RODC
commit 55054182b2989c6432e20a61c9b281596d5682ef
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Sep 29 18:53:51 2011 -0700
dsdb: fix double-free in replication failure case on RODC
commit 5c5d86997593fd7ed9efc0f214f2e978c13083ac
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Sep 29 17:05:38 2011 -0700
s4-dsdb Allow repl server to start even when no master NCs are present
-----------------------------------------------------------------------
Summary of changes:
source4/dsdb/repl/drepl_partitions.c | 8 +-----
source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 34 +++++++++++++++++++---
2 files changed, 30 insertions(+), 12 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/dsdb/repl/drepl_partitions.c b/source4/dsdb/repl/drepl_partitions.c
index 934c75e..7c54245 100644
--- a/source4/dsdb/repl/drepl_partitions.c
+++ b/source4/dsdb/repl/drepl_partitions.c
@@ -63,14 +63,8 @@ WERROR dreplsrv_load_partitions(struct dreplsrv_service *s)
}
el = ldb_msg_find_element(res->msgs[0], "hasMasterNCs");
- if (!el) {
- DEBUG(1,("Finding hasMasterNCs element in root_res failed: %s\n",
- ldb_errstring(s->samdb)));
- talloc_free(tmp_ctx);
- return WERR_DS_DRA_INTERNAL_ERROR;
- }
- for (i=0; i<el->num_values; i++) {
+ for (i=0; el && i<el->num_values; i++) {
struct ldb_dn *pdn;
struct dreplsrv_partition *p;
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 7a64242..fff542a 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -2560,7 +2560,7 @@ static int replmd_rename_callback(struct ldb_request *req, struct ldb_reply *are
lpcfg_dnsdomain(lp_ctx),
ldb_dn_get_linearized(olddn));
ret = ldb_module_send_referral(req, referral);
- talloc_free(ac);
+ talloc_free(ares);
return ldb_module_done(req, NULL, NULL, ret);
}
@@ -2931,14 +2931,14 @@ static int replmd_delete(struct ldb_module *module, struct ldb_request *req)
}
msg->elements[el_count++].flags = LDB_FLAG_MOD_ADD;
- ret = ldb_msg_add_empty(msg, "objectCategory", LDB_FLAG_MOD_DELETE, NULL);
+ ret = ldb_msg_add_empty(msg, "objectCategory", LDB_FLAG_MOD_REPLACE, NULL);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
ldb_module_oom(module);
return ret;
}
- ret = ldb_msg_add_empty(msg, "sAMAccountType", LDB_FLAG_MOD_DELETE, NULL);
+ ret = ldb_msg_add_empty(msg, "sAMAccountType", LDB_FLAG_MOD_REPLACE, NULL);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
ldb_module_oom(module);
@@ -3286,7 +3286,7 @@ static int replmd_op_add_callback(struct ldb_request *req, struct ldb_reply *are
const struct ldb_val *rmd_value, *omd_value;
struct replPropertyMetaDataBlob omd, rmd;
enum ndr_err_code ndr_err;
- bool rename_incoming_record;
+ bool rename_incoming_record, rodc;
struct replPropertyMetaData1 *rmd_name, *omd_name;
if (ares->error != LDB_ERR_ENTRY_ALREADY_EXISTS) {
@@ -3295,7 +3295,31 @@ static int replmd_op_add_callback(struct ldb_request *req, struct ldb_reply *are
return replmd_op_callback(req, ares);
}
- /*
+ ret = samdb_rodc(ldb_module_get_ctx(ar->module), &rodc);
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ /*
+ * we have a conflict, and need to decide if we will keep the
+ * new record or the old record
+ */
+ conflict_dn = req->op.add.message->dn;
+
+ if (rodc) {
+ /*
+ * We are on an RODC, or were a GC for this
+ * partition, so we have to fail this until
+ * someone who owns the partition sorts it
+ * out
+ */
+ ldb_asprintf_errstring(ldb_module_get_ctx(ar->module),
+ "Conflict adding object '%s' from incoming replication as we are read only for the partition. \n"
+ " - We must fail the operation until a master for this partition resolves the conflict",
+ ldb_dn_get_linearized(conflict_dn));
+ goto failed;
+ }
+
+ /*
* we have a conflict, and need to decide if we will keep the
* new record or the old record
*/
--
Samba Shared Repository
More information about the samba-cvs
mailing list