diff options
author | Fernando J V da Silva <fernandojvsilva@yahoo.com.br> | 2010-04-15 17:37:40 -0300 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-22 19:36:15 +1000 |
commit | 57bcdf008fa44d4c550819cbceada968b11be63c (patch) | |
tree | c404018cef84c2e07b26a48f7618cfa31b76c622 /source4/dsdb/kcc | |
parent | c023fc217ed370e5c890c1984da533e0133060d9 (diff) | |
download | samba-57bcdf008fa44d4c550819cbceada968b11be63c.tar.gz samba-57bcdf008fa44d4c550819cbceada968b11be63c.tar.bz2 samba-57bcdf008fa44d4c550819cbceada968b11be63c.zip |
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 <tridge@samba.org>
Diffstat (limited to 'source4/dsdb/kcc')
-rw-r--r-- | source4/dsdb/kcc/kcc_topology.c | 18 |
1 files changed, 15 insertions, 3 deletions
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; |