diff options
author | Garming Sam <garming@catalyst.net.nz> | 2016-07-05 15:57:28 +1200 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2016-07-21 06:37:08 +0200 |
commit | 9206a10a8c73cab8e989dcec9b93a9216e5deba2 (patch) | |
tree | c982eb95f077d4d12d6319520baacdeb1d5231a5 /python | |
parent | 9dfd55c83aeafc6fdd76db87b03db6687e27e1f7 (diff) | |
download | samba-9206a10a8c73cab8e989dcec9b93a9216e5deba2.tar.gz |
samba_kcc: match translate connection from old KCC for RODC
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/kcc/__init__.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/python/samba/kcc/__init__.py b/python/samba/kcc/__init__.py index e56021f66a6..e4dfc7fd86f 100644 --- a/python/samba/kcc/__init__.py +++ b/python/samba/kcc/__init__.py @@ -885,8 +885,23 @@ class KCC(object): # If we have the replica and its not needed # then we add it to the "to be deleted" list. for dnstr in current_rep_table: - if dnstr not in needed_rep_table: - delete_reps.add(dnstr) + # If we're on the RODC, hardcode the update flags + if ro: + c_rep = current_rep_table[dnstr] + c_rep.load_repsFrom(self.samdb) + for t_repsFrom in c_rep.rep_repsFrom: + replica_flags = (drsuapi.DRSUAPI_DRS_INIT_SYNC | + drsuapi.DRSUAPI_DRS_PER_SYNC | + drsuapi.DRSUAPI_DRS_ADD_REF | + drsuapi.DRSUAPI_DRS_SPECIAL_SECRET_PROCESSING | + drsuapi.DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP | + drsuapi.DRSUAPI_DRS_NONGC_RO_REP) + if t_repsFrom.replica_flags != replica_flags: + t_repsFrom.replica_flags = replica_flags + c_rep.commit_repsFrom(self.samdb) + else: + if dnstr not in needed_rep_table: + delete_reps.add(dnstr) DEBUG_FN('current %d needed %d delete %d' % (len(current_rep_table), len(needed_rep_table), len(delete_reps))) |