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

98979 Commits

Author SHA1 Message Date
Douglas Bagnall
d6f12159d1 KCC: avoid (so far harmless) variable name clash
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>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri May 29 09:45:23 CEST 2015 on sn-devel-104
2015-05-29 09:45:23 +02:00
Douglas Bagnall
5aa3fca44d KCC: colour dot graph vertices as well as edges
It's quicker to see who is RODC.

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-05-29 06:58:27 +02:00
Douglas Bagnall
2e9fefc738 KCC: use connect_table.values(), not .items() where that's best
The keys in dsa.connect_table objects are fairly arbitrary strings
(containing guids) and are of no use except when we're deleting
connections. Looping over the .items() clutters up the namespace and
potentially confuses or clobbers, given the hugeness of some of these
functions.

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-05-29 06:58:27 +02:00
Douglas Bagnall
68bb12bef1 KCC: adjust update_rodc_connection to cope with multiple 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-05-29 06:58:27 +02:00
Douglas Bagnall
b01100bf94 KCC: use a table of bridgeheads to simplify and clarify
Looping over lists to find membership has bitten us enough times.

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-05-29 06:58:27 +02:00
Douglas Bagnall
9ad8a321dc KCC: remove unused enumeration variable
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-05-29 06:58:27 +02:00
Douglas Bagnall
c7bf297e00 KCC: a "should not happen" vanishing DSA is worth a warning
Not just a debug message.

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-05-29 06:58:27 +02:00
Douglas Bagnall
dc8aa6f006 KCC: index DSAs by guid and dn_str when loading sites
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-05-29 06:58:27 +02:00
Garming Sam
ce707aec0c kcc: Change create_connection to properly query existing connections
Originally it didn't correctly detect the right 'from server' continuing
with any connection.

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-05-29 06:58:27 +02:00
Douglas Bagnall
0e77967c31 KCC: samba_kcc --test-all-reps-from tries to graph repsfrom
In future it may try to verify them too. Right now it reveals that KCC
is broken.

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-05-29 06:58:27 +02:00
Douglas Bagnall
8877716d98 KCC: sort vertices by ndr_packed_guid instead of string guid
ndr_packed guids seems to be what windows uses.

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-05-29 06:58:27 +02:00
Douglas Bagnall
6c24a7b956 KCC: changes in debugging messages
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-05-29 06:58:27 +02:00
Douglas Bagnall
948da9474d KCC: warn when we are ignoring 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-05-29 06:58:27 +02:00
Douglas Bagnall
6153cf5cea KCC: waste less time assigning transport a NULL guid
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-05-29 06:58:27 +02:00
Douglas Bagnall
e278722635 KCC: use a set to track kept 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-05-29 06:58:27 +02:00
Douglas Bagnall
4d0f892a1a KCC: Comment about schedule types
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-05-29 06:58:27 +02:00
Douglas Bagnall
71045b3325 KCC: add options to forget local and intersite links
The graphs formed using these options are likely to be different from
those you would normally get, which is OK because this is only for
testing.

Also add a helper function to draw a graph from DSA tables.

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-05-29 06:58:27 +02:00
Douglas Bagnall
cf362abe4b KCC: kcc.my_site_guid was not really used
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-05-29 06:58:27 +02:00
Douglas Bagnall
73fe7ed8ec KCC: use more efficient, less polluting dictionary operations
`in d` is more efficient and idiomatic than `in d.keys()`.

`for v in d.values()` is better than `for k, v in d.items()` when `k`
is not used.

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-05-29 06:58:27 +02:00
Douglas Bagnall
9b7d11bf58 KCC: truth in documentation
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-05-29 06:58:27 +02:00
Douglas Bagnall
b1c9039d51 KCC: a whole lot of debugging messages
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-05-29 06:58:27 +02:00
Douglas Bagnall
8ff60938ce KCC: correctly update flags when repsFrom schedule is changed
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-05-29 06:58:26 +02:00
Douglas Bagnall
59af1b5175 KCC: fix is_bridgehead_failed() according to documentation
Throughout the KCC specification `detectFailedDCs` is documented along
the lines of "true to detect failed DCs", and it gets passed down to
this function. And what do we see here? It is used as a default value
when a stale link is not detected. That is entirely different. So who is
right -- the comments or the pseudo-code?

This commit follows the comments. It works!

   Documentation 1,  Pseudo-code 0

See [MS-ADTS] — v20140502, section 6.2.2.3.4.4, page 569.

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-05-29 06:58:26 +02:00
Douglas Bagnall
bb945df0ef KCC: set site topo_generator in RO case, for debug clarity
This has no actual effect except that it makes the Site object print with
the site_topo_generator that is actually used (because RODCs are always
their own topology generators and this variable doesn't affect that).

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-05-29 06:58:26 +02:00
Douglas Bagnall
e299fbcc40 KCC: colour dsa dot graphs, and plot site edges
The red links in the dsa graphs are RODC topology.

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-05-29 06:58:26 +02:00
Douglas Bagnall
1b681ee1c9 KCC: don't try to connect to a nonexistent bridgehead
If self.get_bridgehead returns None, there are no eligible bridgeheads
over there to connect to.

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-05-29 06:58:26 +02:00
Douglas Bagnall
68ef17f8ee KCC: Don't form self connections
This was a bug found in the original script.

We have found a remote bridgehead to connect to, but we were accidentally
connection to ourselves instead. Oops.

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-05-29 06:58:26 +02:00
Douglas Bagnall
6146a8a3f8 KCC: reuse convert_schedule_to_repltimes() for Sitelinks
This means wrenching it out of NTDSConnection, where it didn't really need to be anyway.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
3aad85f2a2 KCC: fix NTDSConnection.convert_schedule_to_repltimes
There were two bugs: the wrong nibbles were being added, and they weren't actually being saved.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
a8a172471f KCC: InternalEdge should know its sitelink
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-29 06:58:26 +02:00
Douglas Bagnall
2bb2480765 KCC: use rep.is_default rather than non-existent part.is_default
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-05-29 06:58:26 +02:00
Douglas Bagnall
92a9bce475 KCC: debugging changes
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-05-29 06:58:26 +02:00
Douglas Bagnall
fee5717cad KCC: add colouring for DSA link graphs
Red for RODC, blue otherwise.

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-05-29 06:58:26 +02:00
Douglas Bagnall
66116d5b73 KCC: Use fake guids in readonly mode
This is necessary because the connections need to look valid so they are
found when unnecesary connections are removed. The usual way is to query
the database for the guid.

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-05-29 06:58:26 +02:00
Douglas Bagnall
660e1258c6 KCC: beginning of --test-all-reps-from, exposing brokenness
This should produce a list of repsFrom links from all DSAs, which together
should produce a nice graph.

samba_kcc --test-all-reps-from won't actually run, but the problems are
things it found rather than caused.

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-05-29 06:58:26 +02:00
Douglas Bagnall
35f2b2b264 KCC: kcc.list_dsas() returns a list rather than prints it
This will be useful for the --test-all-reps-from option.

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-05-29 06:58:26 +02:00
Douglas Bagnall
8a8ba28f40 KCC: intrasite doesn't need a ring with < 3 nodes
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-05-29 06:58:26 +02:00
Douglas Bagnall
5fbdf6e8cb KCC: intrasite graph only uses local DSAs
In the specs this is implied by the special definition of 'implies'.

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-05-29 06:58:26 +02:00
Douglas Bagnall
49e13f8310 KCC: post-Kruskal graph test only needs multi-edge-forest
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-05-29 06:58:26 +02:00
Douglas Bagnall
4ad04a0f6f KCC: minor formatting changes
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-05-29 06:58:26 +02:00
Douglas Bagnall
5c72b13887 KCC: move console colours from kcc_utils to graph_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-05-29 06:58:26 +02:00
Douglas Bagnall
c33761d9be KCC: pep8 for ldif_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-05-29 06:58:26 +02:00
Douglas Bagnall
070c9f7094 KCC: move ldif import/export functions into their own module
They might be of use elsewhere, and they are easily separable from the
KCC core.

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-05-29 06:58:25 +02:00
Douglas Bagnall
e753d11e4d KCC: rearrange samba_kcc entry point
For locality, so that it becomes clearer which variables are used
where.

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-05-29 06:58:25 +02:00
Douglas Bagnall
00e8d929ba KCC: move import to top of file
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-05-29 06:58:25 +02:00
Douglas Bagnall
e66a86b45c KCC: add an option to list valid DSA dn_strs
This makes testing a bit easier.

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-05-29 06:58:25 +02:00
Douglas Bagnall
edd4aa2d47 KCC graph_utils: rename KCCGraphError, GraphError
In case it gets used elsewhere.

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-05-29 06:58:25 +02:00
Douglas Bagnall
222b8221d3 KCC: try graphing edges in colour for partition type
It doesn't add much.

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-05-29 06:58:25 +02:00
Douglas Bagnall
195b9f4c79 KCC: shift graph plotting and verification into a separate module
These might possibly be useful outside the KCC context, and the don't
rely on the rest of kcc_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-05-29 06:58:25 +02:00
Douglas Bagnall
d383cd6f5e KCC: improved documentation for verify_graph_directed_double_ring
The actual function is still somewhat broken.

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-05-29 06:58:25 +02:00