summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>2015-06-25 16:38:29 +1200
committerAndrew Bartlett <abartlet@samba.org>2015-10-29 05:08:15 +0100
commit0f8f99f6af2785d6774ca9436b6eef2078a246df (patch)
tree4018db646f09971433825fa920eb3f1b44c0d4d0 /python
parent24ae662eaee03a0e5d1046acf6882bc6842f518a (diff)
downloadsamba-0f8f99f6af2785d6774ca9436b6eef2078a246df.tar.gz
samba-0f8f99f6af2785d6774ca9436b6eef2078a246df.tar.bz2
samba-0f8f99f6af2785d6774ca9436b6eef2078a246df.zip
KCC: remove useless comments and simplify get_dsa_for_implied_replica()
These comments are a close reflection (or possibly copy/paste) of the spec, but our code here no longer resembles the spec. We end up just glazing over when we see comments and losing track of the flow of code. If you want the spec just look at the spec. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-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__.py41
1 files changed, 9 insertions, 32 deletions
diff --git a/python/samba/kcc/__init__.py b/python/samba/kcc/__init__.py
index 9e69b391407..015278f2196 100644
--- a/python/samba/kcc/__init__.py
+++ b/python/samba/kcc/__init__.py
@@ -800,14 +800,12 @@ class KCC(object):
:param cn_conn: NTDS Connection
:return: source DSA or None
"""
- #XXX different conditions for "implies" than MS-ADTS 6.2.2
+ # XXX different conditions for "implies" than MS-ADTS 6.2.2
+ # preamble.
- # NTDS Connection must satisfy all the following criteria
- # to imply a repsFrom tuple is needed:
- #
- # cn!enabledConnection = true.
- # cn!options does not contain NTDSCONN_OPT_RODC_TOPOLOGY.
- # cn!fromServer references an nTDSDSA object.
+ # It boils down to: we want an enabled, non-FRS connections to
+ # a valid remote DSA with a non-RO replica corresponding to
+ # n_rep.
if not cn_conn.is_enabled() or cn_conn.is_rodc_topology():
return None
@@ -819,36 +817,15 @@ class KCC(object):
if s_dsa is None:
return None
- # To imply a repsFrom tuple is needed, each of these
- # must be True:
- #
- # An NC replica of the NC "is present" on the DC to
- # which the nTDSDSA object referenced by cn!fromServer
- # corresponds.
- #
- # An NC replica of the NC "should be present" on
- # the local DC
s_rep = s_dsa.get_current_replica(n_rep.nc_dnstr)
- if s_rep is None or not s_rep.is_present():
- return None
-
- # To imply a repsFrom tuple is needed, each of these
- # must be True:
- #
- # The NC replica on the DC referenced by cn!fromServer is
- # a writable replica or the NC replica that "should be
- # present" on the local DC is a partial replica.
- #
- # The NC is not a domain NC, the NC replica that
- # "should be present" on the local DC is a partial
- # replica, cn!transportType has no value, or
- # cn!transportType has an RDN of CN=IP.
- #
- if not s_rep.is_ro() or n_rep.is_partial():
+ if (s_rep is not None and
+ s_rep.is_present() and
+ (not s_rep.is_ro() or n_rep.is_partial())):
return s_dsa
return None
+
def translate_ntdsconn(self, current_dsa=None):
"""Adjust repsFrom to match NTDSConnections