summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2011-11-05 00:22:47 +0100
committerMatthieu Patou <mat@matws.net>2011-12-19 11:49:19 +0100
commite34fe4dcb60d2fbf7d805fc348d3a25d2d8950b7 (patch)
treea6ccca25ba87cd7dd70208b89ffa184842c48d0a
parentf6435b734ab50b623350b107d014095c49e48e20 (diff)
downloadsamba-e34fe4dcb60d2fbf7d805fc348d3a25d2d8950b7.tar.gz
samba-e34fe4dcb60d2fbf7d805fc348d3a25d2d8950b7.tar.bz2
samba-e34fe4dcb60d2fbf7d805fc348d3a25d2d8950b7.zip
s4-becomedc: replicate first with DRS_CRITICAL_ONLY and DRS_GET_ANC objects for the base dn partition
Windows dcpromo do the same: getncchanges with DRS_GET_ANC and DRS_CRITICAL_ONLY, then it does a getncchanges without those flags for the rest. Signed-off-by: Andrew Tridgell <tridge@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--source4/libnet/libnet_become_dc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index f0f57d6248..c7d0b30503 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -735,6 +735,7 @@ struct libnet_BecomeDC_state {
struct libnet_BecomeDC_Callbacks callbacks;
bool rodc_join;
+ bool critical_only;
};
static int32_t get_dc_function_level(struct loadparm_context *lp_ctx)
@@ -2867,6 +2868,9 @@ static void becomeDC_drsuapi3_pull_domain_send(struct libnet_BecomeDC_state *s)
| DRSUAPI_DRS_FULL_SYNC_IN_PROGRESS
| DRSUAPI_DRS_NEVER_SYNCED
| DRSUAPI_DRS_USE_COMPRESSION;
+ if (s->critical_only) {
+ s->domain_part.replica_flags |= DRSUAPI_DRS_CRITICAL_ONLY | DRSUAPI_DRS_GET_ANC;
+ }
if (s->rodc_join) {
s->schema_part.replica_flags &= ~DRSUAPI_DRS_WRIT_REP;
}
@@ -2912,6 +2916,14 @@ static void becomeDC_drsuapi3_pull_domain_recv(struct tevent_req *subreq)
return;
}
+ if (s->critical_only) {
+ /* Remove the critical and ANC */
+ s->domain_part.replica_flags ^= DRSUAPI_DRS_CRITICAL_ONLY | DRSUAPI_DRS_GET_ANC;
+ s->critical_only = false;
+ becomeDC_drsuapi_pull_partition_send(s, &s->drsuapi2, &s->drsuapi3, &s->domain_part,
+ becomeDC_drsuapi3_pull_domain_recv);
+ return;
+ }
becomeDC_drsuapi_update_refs_send(s, &s->drsuapi2, &s->schema_part,
becomeDC_drsuapi2_update_refs_schema_recv);
}
@@ -3135,6 +3147,7 @@ static void becomeDC_connect_ldap2(struct libnet_BecomeDC_state *s)
c->status = becomeDC_ldap2_move_computer(s);
if (!composite_is_ok(c)) return;
+ s->critical_only = true;
becomeDC_drsuapi3_pull_domain_send(s);
}