1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

99157 Commits

Author SHA1 Message Date
Douglas Bagnall
004a9ba6b1 KCC: shift ReplInfo, MAX_DWORD from kcc.kcc_utils to kcc.graph
They are only used in graph.py.

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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
a6b7a9abc3 KCC: Don't pretend to "load_all_transports"
Samba doesn't do SMTP, so nor does Samba KCC. Because we were
following the spec, we have had special cases for non-IP transports
in numerous places. This removes a few more of those.

The gains are a loss of complexity and the removal of untestable code.

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>

Conflicts:
	python/samba/kcc/__init__.py
2015-06-12 06:57:15 +02:00
Douglas Bagnall
12de3dfe6a KCC: ignore SMTP transport and warn about unknown ones
An info line is enough for SMTP. Warn about other as yet unknown
transports, because we want to know if they turn up.

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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
e6d8a8ec2a KCC: remove "forest_of_rings" verification check
Because it didn't actually check anything.

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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
f8a68af6ff KCC: improve docstring for kcc.graph.get_spanning_tree_edges()
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
9af0a067f0 KCC: improve docstring for kcc.graph.combine_repl_info()
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
4376f1aa1d KCC: improve documentation for KCC.export_ldif()
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
a811df892b KCC: improve documentation for KCC.import_ldif()
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
303c2c028d KCC: print error messages to stderr, not stdout
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
ce9d1d5b27 KCC: improve documentation for KCC.intrasite_max_node_edges()
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
9ff5a38566 KCC: improve documentation for KCC.intersite() and KCC.intrasite()
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
a866b70cd7 KCC: improve docstring for KCC.create_connections()
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
c93c2fcba5 KCC: samba_kcc uses forced_local_dsa in import_ldif
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
6328b100a3 KCC move and fix ldif_import_export and graph_utils tests
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>
2015-06-12 06:57:15 +02:00
Douglas Bagnall
e6991d2a07 KCC: remove dead code that depends on SMTP replication
We don't support SMTP replication and probably never will. This code
is never used, untested, and unlikely to be correct.

The remaining little bit of IP transport code is slightly rewritten.

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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
94094d0c91 KCC: fix KCC.import_ldif() use of forced_local_dsa
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
9f0209a486 KCC: shift tests/ldif_utils.py to tests/kcc/ldif_import_export.py
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
07daef8d85 KCC: shift tests/graph_utils.py to tests/kcc/graph_utils.py
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>
2015-06-12 06:57:14 +02:00
Garming Sam
a0b0a0f91a kcc: Allow RODC to be included in intersite topology
This creates behaviour not described by ADTS. RODC are now treated as
RED, however they are demoted to the equivalent of WHITE when running
the first half of the algorithm.

The change implies that RED does in fact refer to full-replicas, not
writable replicas.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
7c6a6f2bd8 KCC: remove a condition dependant on non-IP transport
Because it is in a loop that ignores non-IP transports

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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
e2eb3f7e9e KCC: Add fake transport EDGE_TYPE_ALL at most once
It was being added in a loop which only ever looped once (because
we only do one transport, IP), so this makes no actual difference
but it is the correct thing.

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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
7f4b7fed1e KCC: simplify repsfrom pruning in KCC.translate_ntdsconn()
This section is actually quite simple -- we don't want a repsFrom if
there is no DRS connection -- but the existing comments and code had
managed to cause us hours of confusion and much gnashing teeth, the
evidence of which will hopefully have been squashed out of the git
history by the time you read this.

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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
7e8a1a8ae9 KCC: improve docstring for KCC.plot_all_connections()
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
fcd8639581 KCC: improve docstring for KCC.run()
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
9b945bdc5b KCC: add multi-site ldif to ldif_import_export test suite
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
a918edced0 KCC: test stub for KCC object
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
eba852cc98 KCC: write dot files in a deterministic, user specified place
We were using randomised tempfile names in /tmp, initially to avoid
overwriting previous runs so as to track progress. Now we hardly ever
care about the old versions, and a user-specified name will be handy
for testing.

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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
169fcd7add KCC: remove unnecessary debug message in KCC.get_all_bridgeheads()
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
bfbb3dc81b KCC: don't generate dot/verify graph edges unless necessary
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
cc375f5f28 KCC: clarify a comment in is_stale_link_connection()
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
7ff2861e71 KCC: explicit None check in refresh_failed_links_connections()
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
747e0804f4 KCC: remove commented out code in KCC.refresh_failed_links_connections()
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
21e276d319 KCC: remove unused method KCC.should_be_present_test()
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
2a776d9f8d KCC: remove an unused variable in KCC.remove_unneeded_ntdsconn()
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
733d6ea6fa KCC: rename is_repsFrom_implied to get_dsa_for_implied_replica, simplify
KCC.is_repsFrom_implied() did more than it sounded like -- it returned
a tuple of (implied, dsa), where the dsa was None if and only if implied
was False, and a DSA object if implied was True. Thus the implied flag
was strictly reduntant and the only caller really only wanted the DSA.
Now it just gets the DSA, or None.

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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
fa22921ed4 KCC: tidy up a missed keystroke in a comment
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>
2015-06-12 06:57:14 +02:00
Douglas Bagnall
b08684c402 KCC: remove unused variable from KCC.modify_repsFrom()
It looks as if this update bitfield was meant to be returned. It isn't,
and none of the callers expect it. Good riddance.

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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
b845e29b26 KCC: move functions used in kcc.graph into kcc.graph
This should have happened when graph.py was split off from kcc_utils,
and we *would* merge it there, but too many things have happened to
these functions in the meantime.

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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
f1b7007883 KCC: add a warning about side-effects in RepsFromTo.__setattr__
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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
c73a571353 KCC: fix combine_repl_info
Previous the supposedly combined repl_info was always the default, all
0x11, repl_info.

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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
ff7a0902dd KCC: clarify a couple of comments in graph.py
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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
cb94863087 KCC: switch samba_kcc over to samba.kcc module
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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
c182df9969 KCC: KCC object keeps lp and creds for live pings
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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
215f1c2c53 KCC improve docstring for KCC.load_samdb()
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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
21b792b7ba KCC improve docstring for KCC.construct_intrasite_graph()
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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
62a7ae5727 KCC improve docstring for update_rodc_connection()
Also make a short-cut early exit visually shorter and earlier.

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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
257219c836 KCC improve docstring for KCC.create_intersite_connections()
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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
6aa9240cb8 KCC improve docstring for refresh_failed_links_connections()
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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
032291f492 KCC: shift samba.ldif_utils to samba.kcc.ldif_import_export
These functions are really only of use for KCC, and they only import and
export rather than be general utils.

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>
2015-06-12 06:57:13 +02:00
Douglas Bagnall
db56d4ae3b KCC: remove remnants of script from samba/kcc/__init__
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>
2015-06-12 06:57:13 +02:00