From 58113e5bc954aba470e1d240d74d7210e9a22dca Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Tue, 28 Mar 2017 14:29:26 +1300 Subject: [PATCH] join.py: Allow RODC to have push replication at join Normally DsAddEntry connects to DRSUAPI, however not in the RODC case. This meant that it never called DsReplicaUpdateRefs and so never got push-replication after join. Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- python/samba/join.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/python/samba/join.py b/python/samba/join.py index 88b8d4b5e35..6a924359407 100644 --- a/python/samba/join.py +++ b/python/samba/join.py @@ -964,8 +964,10 @@ class dc_join(object): if not ctx.RODC: r.options |= drsuapi.DRSUAPI_DRS_WRIT_REP - if ctx.drsuapi: - ctx.drsuapi.DsReplicaUpdateRefs(ctx.drsuapi_handle, 1, r) + if ctx.drsuapi is None: + ctx.drsuapi_connect() + + ctx.drsuapi.DsReplicaUpdateRefs(ctx.drsuapi_handle, 1, r) def join_finalise(ctx): """Finalise the join, mark us synchronised and setup secrets db.""" -- 2.11.4.GIT