samba_kcc: match translate connection from old KCC for RWDC
authorGarming Sam <garming@catalyst.net.nz>
Wed, 20 Jul 2016 22:42:14 +0000 (10:42 +1200)
committerGarming Sam <garming@samba.org>
Thu, 21 Jul 2016 04:37:08 +0000 (06:37 +0200)
This makes it so that repsTo are always regenerated on the target DCs.
This also happens elsewhere in drepl_out, but is to be removed.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/kcc/__init__.py

index e4dfc7fd86fa4a0ab558e04d8a600fee1e8a0d60..192015af7e8506a25f301e2b2a6c62d5f1ed0a70 100644 (file)
@@ -628,6 +628,12 @@ class KCC(object):
         if times != t_repsFrom.schedule:
             t_repsFrom.schedule = times
 
+        # Bit DRS_ADD_REF is set in replicaFlags unconditionally
+        # Samba ONLY:
+        if ((t_repsFrom.replica_flags &
+             drsuapi.DRSUAPI_DRS_ADD_REF) == 0x0):
+            t_repsFrom.replica_flags |= drsuapi.DRSUAPI_DRS_ADD_REF
+
         # Bit DRS_PER_SYNC is set in replicaFlags if and only
         # if nTDSConnection schedule has a value v that specifies
         # scheduled replication is to be performed at least once