From 57bcdf008fa44d4c550819cbceada968b11be63c Mon Sep 17 00:00:00 2001 From: Fernando J V da Silva Date: Thu, 15 Apr 2010 17:37:40 -0300 Subject: s4-drs: samdb_is_rodc() function and new samdb_rodc() function This patch creates the samdb_is_rodc() function, which looks for the NTDSDSA object for a DC that has a specific invocationId and if msDS-isRODC is present on such object and it is TRUE, then consider the DC as a RODC. The new samdb_rodc() function uses the samdb_is_rodc() function for the local server. Signed-off-by: Andrew Tridgell --- source4/dsdb/kcc/kcc_topology.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'source4/dsdb/kcc/kcc_topology.c') diff --git a/source4/dsdb/kcc/kcc_topology.c b/source4/dsdb/kcc/kcc_topology.c index 72eb5e1137..215cc4d47e 100644 --- a/source4/dsdb/kcc/kcc_topology.c +++ b/source4/dsdb/kcc/kcc_topology.c @@ -1155,7 +1155,13 @@ static NTSTATUS kcctpl_get_all_bridgehead_dcs(struct ldb_context *ldb, el = ldb_msg_find_element(transport, "bridgeheadServerListBL"); - rodc = samdb_rodc(ldb); + ret = samdb_rodc(ldb, &rodc); + if (ret != LDB_SUCCESS) { + DEBUG(1, (__location__ ": unable to tell if we are an RODC: %s\n", + ldb_strerror(ret))); + talloc_free(tmp_ctx); + return NT_STATUS_INTERNAL_DB_CORRUPTION; + } transport_name = samdb_result_string(transport, "name", NULL); if (!transport_name) { @@ -3155,6 +3161,7 @@ static NTSTATUS kcctpl_create_connections(struct ldb_context *ldb, struct ldb_dn *transports_dn; const char * const attrs[] = { "bridgeheadServerListBL", "name", "transportAddressAttribute", NULL }; + int ret; connected = true; @@ -3223,14 +3230,19 @@ static NTSTATUS kcctpl_create_connections(struct ldb_context *ldb, return NT_STATUS_INTERNAL_DB_CORRUPTION; } - rodc = samdb_rodc(ldb); + ret = samdb_rodc(ldb, &rodc); + if (ret != LDB_SUCCESS) { + DEBUG(1, (__location__ ": Unable to tell if we are an RODC: %s\n", + ldb_strerror(ret))); + talloc_free(tmp_ctx); + return NT_STATUS_INTERNAL_DB_CORRUPTION; + } for (i = 0; i < st_edge_list.count; i++) { struct kcctpl_multi_edge *edge; struct GUID other_site_id; struct kcctpl_vertex *other_site_vertex; struct ldb_result *res; - int ret; struct ldb_message *transport, *r_bridgehead, *l_bridgehead; uint8_t schedule[84]; uint32_t first_available, j, interval; -- cgit