This avoids touching the LDAP connection after the long replicate cycle, as it may
have timed out
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
ctx.acct_dn = None
ctx.myname = ctx.server.split('.')[0]
ctx.ntds_guid = None
+
+ # Save this early
+ ctx.remote_dc_ntds_guid = ctx.samdb.get_ntds_GUID()
else:
# work out the DNs of all the objects we will be adding
ctx.myname = netbios_name
# We want to appear to be the server we just cloned
if ctx.clone_only:
- guid = ctx.samdb.get_ntds_GUID()
+ guid = ctx.remote_dc_ntds_guid
else:
guid = ctx.ntds_guid