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

760 Commits

Author SHA1 Message Date
Stefan Metzmacher
c49f9abb19 python/tests: add auth_pad test for the dcerpc raw_protocol test
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11982

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 24 18:08:44 CEST 2016 on sn-devel-144
2016-06-24 18:08:44 +02:00
Garming Sam
e2743b110f flapping: temporarily add samba_dnsupdate test
This should be removed when we can run nsupdate on sn-devel

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

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Jun 16 08:37:56 CEST 2016 on sn-devel-144
2016-06-16 08:37:56 +02:00
Garming
b4d2e1016d drs: Send DRSUAPI_DRS_GET_ALL_GROUP_MEMBERSHIP by default
This flag is not implemented in Samba, however, on an RODC replicating from
Windows, failing to send this flag leaves out group memberships.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-06-16 04:40:14 +02:00
Andrew Bartlett
c752e93fc5 selftest: Add a DNS test matching Windows
This performs the same steps as Windows does

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-16 04:40:14 +02:00
Andrew Bartlett
f67a3c2eb9 selftest: confirm samba_dnsupdate works in both nsupdate and samba_tool mode
This can be extended, but already checks the basic functionality

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-16 04:40:14 +02:00
Andrew Bartlett
215c20b94b samba-tool domain join: Refuse to re-join a DC with a still-valid password
While the DC will eventually get back to the same state, it can take a
while, so try harder not to overwrite our already-working account

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-16 04:40:12 +02:00
Andrew Bartlett
2d79b61731 samba-tool: Improve fsmo handling
This makes a clear seperation between data and display variables
and improves the tests.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-16 04:40:12 +02:00
Andrew Bartlett
9173f2027c selftest: Rebase DrsBaseTestCase on SambaToolCmdTest
This then makes SambaToolCmdTest based on BlackboxTestCase.

This allows us to use better command output testing in the fsmo tests

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-16 04:40:12 +02:00
Ralph Boehme
721b21bb80 selftest: add test for DNS updates with TKEY/TSIG
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11520

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Thu Jun 16 04:07:41 CEST 2016 on sn-devel-144
2016-06-16 04:07:41 +02:00
Andrew Bartlett
a8430d15a5 dsdb: Fix incorrect sorting of replPropertyMetaData with RDN last
Per tests against Windows 2012R2 the RDN is not sorted last and is
instead sorted normally with all the other elements.

The RDN attribute, unlike name, is not replicated over DRS, so this
has no interopability impact.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz
2016-06-07 10:28:10 +02:00
Andrew Bartlett
db15993401 dbcheck: Find and fix a missing Deleted Objects container
Older Samba versions could delete this.  This patch tries very hard
to put back the original object, with the original GUID, so that
if another replica has the correct container, that we just merge
rather than conflict.

The existing "wrong dn" check can then put any deleted objects
under this container correctly.

Pair-programmed-with: Garming Sam <garming@catalyst.net.nz>
Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-06 08:50:09 +02:00
Andrew Bartlett
ca2e038aa5 samba-tool domain join: Set drsuapi.DRSUAPI_DRS_GET_ANC during initial repl
This is needed so that we get parents before children.

We need this to ensure that we always know the correct parent for a
new child object, rather than just trusting the DN string

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-06 08:50:09 +02:00
Peter C. Kelly
b929008dc6 Improve help wording for samba-tool domain provision as per https://lists.samba.org/archive/samba-technical/2016-April/113740.html
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11894
Signed-off-by: Peter C. Kelly <peter+sambabugzilla@pck.co.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Jun  2 20:07:22 CEST 2016 on sn-devel-144
2016-06-02 20:07:22 +02:00
Andrew Bartlett
ea840010ee samba-tool domain demote: Fix error handling and error messages
Due to an error in a previous patch, e was undefined

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-06-02 16:36:15 +02:00
Rowland Penny
7583377473 samba-too: Allow 'samba-tool fsmo' to cope with empty or missing fsmo roles
samba-too: Allow 'samba-tool fsmo' to cope with empty or missing fsmo roles

Signed-off-by: Rowland Penny <rpenny@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2016-06-01 00:57:32 +02:00
Stefan Metzmacher
3aefd277f6 python:samba: move netcmd/time.py to python/samba/netcmd/nettime.py
This allows 'import time' to work.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu May 19 15:21:58 CEST 2016 on sn-devel-144
2016-05-19 15:21:58 +02:00
Douglas Bagnall
b3b2fee108 python/tests/dns_forwarder: fix for python 2.6
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Tue May 17 07:39:03 CEST 2016 on sn-devel-144
2016-05-17 07:39:03 +02:00
Andrew Bartlett
ac1ed18f8d classicupgrade: Avoid needing to quote CN values in an DN, use dn.set_component()
While invalid for samAccountName values, when also used for
samAccountName we should be dealing with this at the samldb layer, not
here.

This comes from unvalidated Samba3 data that can contain a , or =
without a problem in that codebase.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-05-11 03:47:04 +02:00
Douglas Bagnall
91f6439929 tests/dcerpc: add tests for string allocation and deletion
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 10 05:11:42 CEST 2016 on sn-devel-144
2016-05-10 05:11:42 +02:00
Douglas Bagnall
4c7a3fd567 tests/dcerpc/array.py: test deletion of arrays
We expect an AttributeError.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-05-10 01:43:15 +02:00
Andrew Bartlett
9e2c1f72e0 join.py: Fetch the remote DC NTDS GUID early
This avoids touching the LDAP connection after the long replicate cycle, as it may
have timed out

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-05-10 01:43:14 +02:00
Douglas Bagnall
4456f38612 python/join.py: Avoid unchecked print in error path
In autobuild this print causes an IOError when stdout is dead,
which hides the exception you care about and prevents the actual
clean up.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-05-10 01:43:14 +02:00
Garming Sam
26cfd75683 tests/dns_forwarder: Add additional testing for no flag recursive
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-05-03 08:10:10 +02:00
Garming Sam
97a7547a41 tests/dns_forwarder: Add an extra test for inactive forwarders
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-05-03 08:10:10 +02:00
Garming Sam
61f1eaf0b4 tests/dns_forwarder: remove statically defined IPs
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-05-03 08:10:09 +02:00
Garming Sam
2570f16497 tests/dns: Add additional testing of CNAME handling
RFC 1034, for instance, describes that all intermediate CNAMEs should be
returned. As it is, CNAME do not return all found intermediate results
in the case of straightforward failure. It should be noted that in the
case of forwarding success, ALL intermediate paths are returned,
including the failure ones.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-05-03 08:10:09 +02:00
Garming Sam
3b2f9f8756 tests/dns_forwarder: Add testing for DNS forwarding
The new tests show that single and multiple forwarders work as expected.
They also describe the behaviour encountered when the DNS server
encounters a CNAME from a forwarded request (which is not to pursue any
further).

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2016-05-03 08:10:09 +02:00
Garming Sam
2ef0c9a8d4 dbcheck: Avoid pathological behaviour in operational module
Because replPropertyMetadata was repeated for every object in the
database, the attrs list became very long.

This single line saves 20% of the time for make test TESTS=dbcheck.

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

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Wed Apr 20 09:12:47 CEST 2016 on sn-devel-144
2016-04-20 09:12:47 +02:00
Garming Sam
0619a83ccf tests/rodc: Check that preload will skip broken users
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Mon Apr 18 07:40:07 CEST 2016 on sn-devel-144
2016-04-18 07:40:06 +02:00
Garming Sam
6d08b41676 rodc: Allow RODC preload to continue with invalid users
Either the user may be missing from the database, or the user is not
included in the RODC password replication group.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-04-18 03:53:23 +02:00
Stefan Metzmacher
4a53c8a588 CVE-2015-5370: python/samba/tests: add some dcerpc raw_protocol tests
These are independent from our client library and allow
testing of invalid pdus.

It can be used like this in standalone mode:

SMB_CONF_PATH=/dev/null SERVER=172.31.9.188 python/samba/tests/dcerpc/raw_protocol.py
or
SMB_CONF_PATH=/dev/null SERVER=172.31.9.188 python/samba/tests/dcerpc/raw_protocol.py -v -f TestDCERPC_BIND.test_invalid_auth_noctx

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11344

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:32 +02:00
Stefan Metzmacher
782e8e2abd CVE-2015-5370: python/samba/tests: add infrastructure to do raw protocol tests for DCERPC
These are independent from our client library and allow
testing of invalid pdus.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11344

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2016-04-12 19:25:32 +02:00
Stefan Metzmacher
85972a559f CVE-2016-2118: python:tests/dcerpc: use [sign] for dnsserver tests
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11616

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2016-04-12 19:25:27 +02:00
Rowland Penny
f777ca33c6 Bug 11818 : obvious missing word When trying to demote a dc, 'remove_dc.remove_sysvol_references' is sent 'remote_samdb, dc_name' , it expects 'remote_samdb, logger, dc_name'
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11818

Signed-off-by: Rowland Penny <rpenny@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr  1 22:54:22 CEST 2016 on sn-devel-144
2016-04-01 22:54:22 +02:00
Garming Sam
c37c4b18e0 CVE-2016-0771: tests/dns: Remove dependencies on env variables
Now that it is invoked as a normal script, there should be less of them.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:25 +01:00
Garming Sam
9f1ba00f1f CVE-2016-0771: tests/dns: change samba.tests.dns from being a unittest
This makes it easier to invoke, particularly against Windows.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:25 +01:00
Garming Sam
8cee2c8146 CVE-2016-0771: tests: rename test getopt to get_opt
This avoids any conflicts in this directory with the original toplevel
getopt.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:25 +01:00
Garming Sam
286b7a5e3f CVE-2016-0771: tests/dns: RPC => DNS roundtrip test
Make sure that TXT entries stored via RPC come out the same in DNS.

This has one caveat in that adding over RPC in Windows eats slashes,
and so fails there.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:25 +01:00
Garming Sam
ffec494826 CVE-2016-0771: tests/dns: modify tests to check via RPC
This checks that TXT records added over DNS, look the same over RPC.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:24 +01:00
Garming Sam
2a796e5de7 CVE-2016-0771: tests/dns: Add some more test cases for TXT records
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:24 +01:00
Garming Sam
bbda6b6eda CVE-2016-0771: tests/dns: Correct error code for formerly unrun test
Both Samba and Windows returned NXRRSET

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:24 +01:00
Garming Sam
5b10cc25be CVE-2016-0771: tests/dns: restore formerly segfaulting test
This was on the client side, due the a strlen(NULL) on the previously
DOS-encoded TXT field. With a new IDL structure, this segfault no longer exists.
Note that both Samba and Windows return NXRRSET instead of FORMERR.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:24 +01:00
Garming Sam
866bf51758 CVE-2016-0771: tests/dns: Add a comment regarding odd Windows behaviour
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:24 +01:00
Garming Sam
a988dc7b2d CVE-2016-0771: tests/dns: FORMERR can simply timeout against Windows
Two requests with identical parameters which are poorly formatted, can
non-deterministically return FORMERR or simply fail to give a response.

Setting the timeout to a number allows Windows to succeed.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:24 +01:00
Garming Sam
2ad53d1c07 CVE-2016-0771: tests/dns: prepare script for further testing
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:24 +01:00
Garming Sam
e09544de63 CVE-2016-0771: tests/dns: Modify dns tests to match new IDL
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11128
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11686

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-03-10 06:52:24 +01:00
Andrew Bartlett
c79c1e405d dbcheck: Check for and remove duplicate values in attributes
This can happen with three DCs and custom schema, but we test
it by just forcing the values directly into the backing tdb.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:30 +01:00
Andrew Bartlett
c36b2d7fb8 dbcheck: Avoid spurious warnings in dbcheck due to objectclass sorting
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11433
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:28 +01:00
Andrew Bartlett
5fb98a3534 dbcheck: Fix incorrect/duplicate attrid in replPropertMetaData
If custom schema is used in a replicated DC environment, these are created as soon as
an attribute is modified on more than one DC.  We have to remove these.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11443
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:28 +01:00
Andrew Bartlett
9e07f3a13b pidl: Fix our python reference handling
The new talloc.BaseObject allow us to hold a talloc context per
python object (there may be many referring to the same C object)
and the talloc context that the actual object pointer is under.

Another advantage is that talloc.BaseObject(), has less of
an ABI surface.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-03-08 01:58:26 +01:00
Rowland Penny
c16e770d96 Remove posixAccount from samdb.py
Signed-off-by: Rowland Penny rpenny@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Mon Mar  7 08:13:42 CET 2016 on sn-devel-144
2016-03-07 08:13:42 +01:00
Andrew Bartlett
eb5cdce247 samba-tool: Support preloading multiple users
Based on patches by Adrian Cochrane

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

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 25 07:58:55 CET 2016 on sn-devel-144
2016-02-25 07:58:55 +01:00
Andrew Bartlett
bd51778dc0 python: Allow optional multi-value arguements for samba-tool commands
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-02-25 04:48:18 +01:00
Michael Adam
00f4bf32db test:docs: remove unused param_table/get_param_table_full()
No tests use this any more, hence we should not
parse the file anymore either. It is generated
directly from the parametersr.all.xml file.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2016-02-08 22:32:23 +01:00
Stefan Metzmacher
915185aa58 python:tests/core: add tests for arcfour_encrypt() and string_to_byte_array()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11699

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Feb  3 11:42:29 CET 2016 on sn-devel-144
2016-02-03 11:42:29 +01:00
Stefan Metzmacher
452234b7bc python:samba/netcmd/domain: make use of the generic arcfour_encrypt() and string_to_byte_array() functions
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11699

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-02-03 08:33:11 +01:00
Stefan Metzmacher
d5423feb4b python:samba/join.py: make use of the generic arcfour_encrypt() and string_to_byte_array() functions
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11699

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-02-03 08:33:11 +01:00
Stefan Metzmacher
078a7ae710 python:samba: add a generic arcfour_encrypt() helper function
This works with Crypto.Cipher.ARC4 (from python*-crypto) and
fallback to M2Crypto.RC4.RC4 (from [python*-]m2crypto).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11699

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-02-03 08:33:11 +01:00
Stefan Metzmacher
65127d1674 python:samba: add a generic string_to_byte_array() helper function
We should avoid implementing this again and again.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11699

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2016-02-03 08:33:11 +01:00
Douglas Bagnall
906a53f442 samldb: ensure subnets have proper net ranges
A subnet name needs to be a valid CIDR address range -- that's the
ones that look like 10.9.8.0/22, where the number after the /
determines how many bits are in the address suffix. It can be IPv4 or
IPv6. There are a few odd constraints (see MS-ADTS v20150630
6.1.1.2.2.2.1 "Subnet Object") -- for example, with IPv4, the implied
bit mask can't equal the address. That is, you can't have a subnet
named "255.255.255.0/24" in a Windows subnet. This rule does not apply
to IPv6.

Windows and Samba both make some ensure that subnets have a unique
valid name, though unfortunately Windows 2008R2 is rather slack when
it comes to IPv6. We follow Windows 2012R2, which roughly follows
RFC5952 -- with one caveat: Windows will allow an address like
"::ffff:0:1:2", which translates to the IPv4 address "0.1.0.2" using
the SIIT translation scheme, and which inet_ntop() would render as
"::ffff:0:0.1.0.2". In the Samba implementation we use an inet_pton()/
inet_ntop() round-trip to establish canonicality, so these addresses
fail. Windows wisely does not allow the SIIT style addresses (the
acronym is widely agreed to be off-by-one in the second letter), and
it will regard "::ffff:0:1:2" as simply "::ffff:0:1:2" and allow it.
We would like to do that too.

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-12-24 04:09:29 +01:00
Douglas Bagnall
cbb93977cd samba-tool: add sites subnet subcommands
This allows you to add, remove, or shift subnets.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-12-24 04:09:29 +01:00
Douglas Bagnall
8e6f2d923c samba-tool tests: Add command line tests for 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-12-24 04:09:29 +01:00
Andrew Bartlett
12813ea555 python/sites: Rework site DN construction
This new routine is safe against escape characters and works
against Windows 2012R2.

The dn= filter in the old code was samba-specific.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-12-24 04:09:29 +01:00
Douglas Bagnall
9ac5e3cf30 samba.sites: reduce code duplication in Exception classes
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-12-24 04:09:29 +01:00
Douglas Bagnall
b27dcb5bca samba.sites: improve grammar in an error 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-12-24 04:09:29 +01:00
Douglas Bagnall
fa2c6685c9 samba-tool sites: use -H to set URL with standard handling
samba-tool sites was defaulting to the local database, but we might
want to use another URL. This allows that case while defaulting to
the old behaviour.

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-12-24 04:09:29 +01:00
Douglas Bagnall
bb64abf954 sambatool sites: PEP8/flake8 improvements
We were nearly there, so lets make the jump. This involves removing
some unused variables.

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>
2015-12-24 04:09:28 +01:00
Matthias Dieter Wallnöfer
8091f84fa4 s4:samba-tool domain raise tool - make it aware of newer domain function levels
http://msdn.microsoft.com/en-us/library/Cc223742.aspx

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date(master): Thu Dec 24 04:08:04 CET 2015 on sn-devel-144
2015-12-24 04:08:04 +01:00
Matthias Dieter Wallnöfer
33ed975398 s4:samba-tool domain raise tool - handle Windows 2000 mode AD domains correctly
Considering http://msdn.microsoft.com/en-us/library/cc220262.aspx they do not
provide any "msDS-Behavior-Version" attributes.

gulikoza <gulikoza@users.sourceforge.net> noticed this correctly.

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-12-24 00:58:33 +01:00
Andrew Bartlett
4807577d30 Fix bug 10881 Wrong keytab permissions when joining additional DC with BIND backend
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10881
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Dec 15 11:47:21 CET 2015 on sn-devel-104
2015-12-15 11:47:21 +01:00
Andrew Bartlett
67b6346e73 python: Give a more helpful error message when we do not have an smb.conf
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-12-15 08:42:20 +01:00
Rowland Penny
fbcf1d2b0f samba-tool: user create examples show 'add' instead of 'create'
Signed-off-by: Rowland Penny <repenny241155@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-07 17:59:07 +01:00
Rowland Penny
4735e5f5e3 samba-tool: fsmo.py throws an uncaught exception if no
fSMORoleOwner attribute

This will fix bug 11613 where a user got the uncaught exception when trying
to seize an FSMO role that didn't have the required attribute.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11613

Signed-off-by: Rowland Penny <repenny241155@gmail.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Sun Dec  6 00:33:10 CET 2015 on sn-devel-104
2015-12-06 00:33:10 +01:00
Uri Simchoni
22386dc396 samba-tool: replace use of os.popen
The netcmd/domain.py module uses os.popen() on user-supplied
parameters. This opens up the way to code injection.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11601

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Mon Nov 23 22:19:34 CET 2015 on sn-devel-104
2015-11-23 22:19:34 +01:00
Rowland Penny
0111773310 samba-tool:provision: fix bug 11600
If you join a second DC after changing the name of
the 'Default Domain Policy' or 'Default Domain Controllers
Policy' the join will fail as the search is hardcoded to
these names, this fix changes the search to the objects name.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11600

Signed-off-by: Rowland Penny <repenny241155@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat Nov 21 04:44:58 CET 2015 on sn-devel-104
2015-11-21 04:44:58 +01:00
Mathieu Parent
c315fce17e Fix various spelling errors
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Nov  6 13:43:45 CET 2015 on sn-devel-104
2015-11-06 13:43:45 +01:00
Douglas Bagnall
46ac3a5308 KCC: kcc.import_ldif doesn't need creds
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-10-29 05:08:16 +01:00
Douglas Bagnall
6f93ffaf0c KCC: remove NTDSConnection API methods that are never used
These are not used, and using them would not be considered Pythonic. The
flags they alter are always changed directly.

The similar set_modified() method IS 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-10-29 05:08:16 +01:00
Douglas Bagnall
b93205ebe4 KCC: whitespace for pep8
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-10-29 05:08:16 +01:00
Douglas Bagnall
1d5bb5996e KCC: fix pep8 line length in load_ip_transport()
You are right to sigh about this one.

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-10-29 05:08:16 +01:00
Douglas Bagnall
ab63f1a983 KCC: Correct capitalisation of KCCError
previously we had "raise KccError", which of course would raise a
NameError.

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-10-29 05:08:16 +01:00
Douglas Bagnall
e9f0799a18 KCC: raise KCCError, not Exception, in multiple places
"except Exception" lines will still catch them, but more fine-grained
control is possible.

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-10-29 05:08:16 +01:00
Douglas Bagnall
26384192d5 KCC: NTDSConnection.load_connection() requires objectGUID
If there is no GUID, that is an error, so we raise an exception instead
of stepping around it.

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-10-29 05:08:15 +01:00
Douglas Bagnall
8f5936261f KCC: remove debug print statements from intrasite and intersite
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-10-29 05:08:15 +01:00
Douglas Bagnall
8fe9992cff KCC: load samdb before calling kcc.run()
kcc.run() is a mega-function that does nearly everything, including
loading the database. The --list-valid-dsas and --test-all-reps-from
tasks also want to load the database, but not do all that other run()
stuff, so it makes sense to pull it out. When the samdb has not been
loaded, run() will still load it -- this avoids having to change all
the 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-10-29 05:08:15 +01:00
Douglas Bagnall
47b3334f48 KCC: load the object GUID with --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-10-29 05:08:15 +01:00
Douglas Bagnall
30330b4df8 KCC: avoid logging alarming things about exected events
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-10-29 05:08:15 +01:00
Douglas Bagnall
e442726c3d KCC: more debug info when --import-ldif goes badly
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-10-29 05:08:15 +01:00
Douglas Bagnall
acd77283cc KCC: default to not loading new samdb when we already have one
This should make things simpler in the --import-ldif case.

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-10-29 05:08:15 +01:00
Douglas Bagnall
76f195a279 KCC: fix typo in error path
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-10-29 05:08:15 +01:00
Douglas Bagnall
6f78ad2450 KCC: better explain our confusion in colour_vertices comment
Reviewed-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-10-29 05:08:15 +01:00
Douglas Bagnall
310aa2f340 KCC: clarify debugging messages in bridgehead finding 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>
2015-10-29 05:08:15 +01:00
Douglas Bagnall
5f60c4bf33 KCC: keep track of IP transport for dsa.new_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-10-29 05:08:15 +01:00
Douglas Bagnall
059e2838c8 KCC: set system flags for new intrasite connections
These flags are mandatory for intrasite 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-10-29 05:08:15 +01:00
Douglas Bagnall
704fd83bcf KCC: correctly use dsa.new_connection() system_flags argument
The dsa.system_flags attribute is important and gets saved in the
database, but was never getting altered because we were setting dsa.flags
instead.

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-10-29 05:08:15 +01:00
Garming Sam
4bf95b6b32 KCC: Use detect_failed in create_connections
Without this, dead DCs were treated as live, and could be used in the
tree. If they're in the tree they can split the network.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-10-29 05:08:15 +01:00
Douglas Bagnall
0f8f99f6af 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>
2015-10-29 05:08:15 +01:00
Douglas Bagnall
24ae662eae KCC: stop --forget-intersite-links forgetting local links
It will still forget intrasite links on other sites, but that in theory
should not matter.

It will still break your network, and is only useful for debugging.

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-10-29 05:08:15 +01:00
Douglas Bagnall
eec0d119ac KCC: simplify get_dsa_for_implied_replica(), using IP invariant
We only do IP transports. Therfore the long list of alternatives...

                   (not n_rep.is_domain() or
                    n_rep.is_partial() or
                    cn_conn.transport_dnstr is None or
                    cn_conn.transport_dnstr.find("CN=IP") == 0)

that ends with the equivalant of "is this IP?" always evaluates to True.

If we leave it there it will confuse people for ever.

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-10-29 05:08:15 +01:00
Douglas Bagnall
5bbcbe380b KCC: Share commit wrapper between forget_ntdsconn and intrasite
The wrapper is only to create DEBUG output in read-only mode --
normally it amounts to `dsa.commit_connections(self.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-10-29 05:08:15 +01:00
Douglas Bagnall
03e352268a KCC: pull apart remove_unneeded_ntdsconn(), fixing intersite
The confusing big mess was hiding bugs. Firstly, intersite links on
non-intersite-topology-generators were not getting looked at. Secondly,
the logic around superseding intersite links was missing.

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-10-29 05:08:15 +01:00
Douglas Bagnall
472735f26c KCC: shift common is_generated() check out of branches
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-10-29 05:08:15 +01:00
Andrew Bartlett
55a13e17b3 samba-tool domain demote: Add support for removing by NTDS GUID
This would help remove a DC that is a conflict record, for example

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
e57dcddfe8 samba-tool domain demote: Add --verbose and --quiet options
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
642de9193f samba-tool domain demote: Remove dns-SERVER object as well
This object is not in standard AD, but Marc Muehlfeld
correctly notes that Samba creates it for BIND9_DLZ

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
145bb6fd7b samba-tool domain demote: Remove all references to the demoted host, even in DNS
We search the in-directory DNS records for entries that point to the
name or IP that the dead DC was using, and remove them

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
3226077627 pydns: Add replace_by_dn()
This allows us to find a DNS record by searching LDB and unpacking the dnsRecord
but replace the record using the common code that will create a tombstone

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
a3b92a50d1 samba-tool domain demote: Use dn.add_base/dn.add_child
This is done primarilly to set the pattern that we should manipulate ldb.Dn values
with the helper routines, not just by concatonation via format strings.

We also restrict our exception hadling to only the expected errors, not
all errors.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
00ffb67be2 samba-tool domain demote: Remove correct DNs and from the correct locations
The previous code missed the CN=DFSR-GlobalSettings children and did
not cope with subdomains.  The root DN may not be the domain DN if
we are a subdomain.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
27039a7b1c selftest: Add tests confirming the demote actually removes objects
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
e432c1b682 samba-tool domain demote: Refuse to remove ourself
This ensures that a different server is the one being demoted from the local database

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
097435cfd9 selftest: Run samba-tool domain demote while we have a clone of the DB handy
This avoids needing to run the demote on the main replicated DB
of the selftest system

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
1f88353713 samba-tool domain demote: Rework to allow cleanup of partial demotion, catch more errors
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
8086900077 selftest: Make it clear that the first argument to KCC.run() is unused
This is unused because we have already provided a database via import_ldif

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:22 +01:00
Andrew Bartlett
f121173cbf samba-tool domain demote: Allow to operate on an RODC and a subdomain
On an RODC the local database cannot be modified, and the flags to remove
are different, we need instead to remove UF_PARTIAL_SECRETS_ACCOUNT.

If we are in a subdomain, then db.get_root_basedn() points to the
forest root, not the root of our domain

If the removeDsServer() fails with WERR_DS_DRA_NO_REPLICA
this may be reasonably considered to be success in this case.

Finally, the remove_dc.remove_sysvol_references() is reused
for objects not under the computer account.

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

domain demote

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
1874f59200 samba-tool domain demote: Add --remove-other-dead-server
The new version of this tool now can remove another DC that is
itself offline.  The --remove-other-dead-server removes
as many references to the DC as possible.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
2191fcaedc dns_server: Add python method to extract a DNS entry from a ldb.MessageElement
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
b48776d78b pydsdb: Also accept ldb.MessageElement values to dsdb routines
This shows the correct way to accept a value that may be a list of strings
or a proper ldb.MessageElement.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
87cd68c1dc dns_server: Add a python module directly accessing DNS records in sam.ldb
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
2715805f4c selftest: Add tests for samdb_to_ldif_file
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
dadfffb519 python/kcc: Write correct module list into the file during ldif_to_samdb
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
ffe8090c89 samba-tool drs clone-dc-database: Require --targetdir
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
d1d5ec311a samba-tool drs clone-dc: Add --include-secrets option
This allows the creation of domain clones that have no secrets,
and so make it safer to examine databases that demonstrate issues

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
6d301ad1c9 samba-tool: Add new command 'samba-tool drs clone-dc-database'
This command makes a clone of an existing AD Domain, but does not
join the domain.  This allows us to test if the join would work
without adding objects to the target DC.

The server password will need to be reset for the clone to
be any use, see the source4/scripting/devel/chgtdcpass

(Based on patches written with Garming Sam)

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
80171ddcff samba-tool: Remove vampire subcommand and now unused libnet_Vampire()
This has been deprecated for a long time now

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26 05:11:21 +01:00
Andrew Bartlett
71dcc76b70 build: Enable NTVFS file server to be omitted
We now only build it by default with --enable-sefltest, or otherwise
if requested.

The NTVFS file server still has features not present in the smbd file
server, such as a CIFS/SMB proxy, and a radically different design,
but it is also not undergoing any ongoing development so this keeps it
in a safe state for care and maintaince, with less of a security risk
if such an issue were to come up.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-23 22:27:30 +02:00
Andrew Bartlett
f00dd4a8d1 provision: Allow more OS levels in sambadns
While we do not support these yet, they make no difference to DNS, so permit up to 2012R2

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Oct 20 23:23:13 CEST 2015 on sn-devel-104
2015-10-20 23:23:13 +02:00
Andrew Bartlett
5701b99b5c samba-tool dns: Trap on conneciton errors and give useful info
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-20 20:22:22 +02:00
Douglas Bagnall
7163e08caa samba-tool --help: possessive pronoun "its" has no apostrophe
"it's" is reserved for the contraction of "it is".

This *is* somewhat illogical, which is how you know its proper
English.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-16 13:35:10 +02:00
Ralph Boehme
875beefced samba-tool: add command to dump dosinfo xattr from a file
Add a new command "getdosinfo" to samba-tool to dump dosinfo xattr from
a file.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Sep 29 06:00:49 CEST 2015 on sn-devel-104
2015-09-29 06:00:49 +02:00
Andrew Bartlett
5aefea8425 python/tests: Add more assertions that we get back the value we expect
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11429

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep  1 17:00:53 CEST 2015 on sn-devel-104
2015-09-01 17:00:52 +02:00
Andrew Bartlett
1f50e19451 python/tests: Add tests for 64 bit signed integers
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11429

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-09-01 14:01:23 +02:00
Petr Viktorin
f1f47ac934 python: Remove uuid module
The uuid module was only built for Python 2.4 and lower, which Samba
no longer supports.

Python 2.5+ includes uuid in its standard library.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Aug 29 04:03:49 CEST 2015 on sn-devel-104
2015-08-29 04:03:49 +02:00
Matthieu Patou
6122acad0f ldb: create a cache of known wellknown objects instead of continously searching in the db
Profiling on dbcheck have shown that we spend 10% of the time looking
for wellknown objects.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973

Change-Id: I13ed58e8062d1b7b6179d17b0e7e56f943572c6c
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24 23:46:22 +02:00
Andrew Bartlett
c049106bf8 dbcheck: Use set() operations to make dbcheck more efficient
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24 23:46:22 +02:00
Andrew Bartlett
fb88f9cbd9 dbcheck: Try to avoid duplicate searches
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24 23:46:22 +02:00
Andrew Bartlett
2ff9b17137 dbcheck: Add additional tests for the attributeID list
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24 23:46:22 +02:00
Andrew Bartlett
2766bad5ef dbcheck: Add explict tests for unknown and unsorted attributeID values
Unknown attributeID values would cause an exception previously, and
unsorted attributes cause a failure to replicate with Samba 4.2.

In commit 61b978872f we started
to sort these values correctly, but previous versions of Samba
did not sort them correctly (we sorted high-bit-set values as
negative), and then after 9c9df40220
we stoped accepting these.

To ensure we are allowed to make this unusual change to the
replPropertyMetaData, a new OID is allocated and checked
for in repl_meta_data.c

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10973

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24 23:46:22 +02:00
Andrew Bartlett
336d41155e python/tests: Add tests for integer overflow handling
This also documents an issue with our python bindings and lists, as changes to integers in a list
of integers are not preserved

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11429

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24 23:46:22 +02:00
Andrew Bartlett
3faa7dc5a7 python: Use an unsigned integer for buf_size, not -1
This will fail once our python bindings correctly check value ranges

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11429

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-08-24 23:46:22 +02:00
Andrew Bartlett
a431828460 python:samba/upgrade.py Fix format string syntax in error condition
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11436
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Aug 14 10:52:39 CEST 2015 on sn-devel-104
2015-08-14 10:52:39 +02:00
Kai Blin
42f38fe8d9 dns: always add authority records
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Thu Aug  6 14:06:52 CEST 2015 on sn-devel-104
2015-08-06 14:06:52 +02:00
Michael Adam
8ad079da0c tests:docs: don't load or test the static param_table.
It is going to be removed for the generated table.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:33 +02:00
Michael Adam
c102ac2896 tests:docs: remove testing the diff between the static and generated table
This reverts commit 380e0769ad3563dc762fb0c9ebe57d8131846519.

This is in preparation of the removal of the committed param_table_static.c

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:33 +02:00
Michael Adam
cf16ae5633 tests:docs: test the diff between the static and generated table
This proves that the committed and the generated parameter tables
are identical (modulo order).

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:32 +02:00
Michael Adam
93c8e8db89 tests:docs: load the full data from the generated param_table
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:32 +02:00
Michael Adam
5efa507e7a tests:docs: load the full data from the existing param_table.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:32 +02:00
Michael Adam
2ede42e413 tests:docs: add a function to load the full data structures from the table
instead of just loading the list of parameter names.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:32 +02:00
Michael Adam
a9187359cf tests:docs: print more complicated structures than strings in the message.
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:32 +02:00
Michael Adam
3de5d29925 tests:docs: common initialization in docs test.
Just load the structures once at startup.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:32 +02:00
Michael Adam
bbd55f69a0 param: move the actual table out into param_table_static.c
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:32 +02:00
Michael Adam
317bd295d8 tests:docs: teach the test the types cmdlist, bytes, octal, and ustring
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:32 +02:00
Michael Adam
3bd477e7ee tests: teach the docs test about boolean-rev
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-31 01:55:29 +02:00
Stefan Metzmacher
cab82ebda7 samba-tool: add 'domain trust *' commands
Available subcommands:
  create      - Create a domain or forest trust.
  delete      - Delete a domain trust.
  list        - List domain trusts.
  namespaces  - Manage forest trust namespaces.
  show        - Show trusted domain details.
  validate    - Validate a domain trust.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
41f08b1964 python/samba: add on optional 'special_name' argument to CredentialsOptions()
This way we have have two sets or credentials on the command line,
while at least one uses some prefix (special_name) for the arguments.

The default options without special_name are:

  Credentials Options:
    --simple-bind-dn=DN
                        DN to use for a simple bind
    --password=PASSWORD
                        Password
    -U USERNAME, --username=USERNAME
                        Username
    -W WORKGROUP, --workgroup=WORKGROUP
                        Workgroup
    -N, --no-pass       Don't ask for a password
    -k KERBEROS, --kerberos=KERBEROS
                        Use Kerberos
    --ipaddress=IPADDRESS
                        IP address of server
    -P, --machine-pass  Use stored machine account password

With special_name='local-dc' it's:

  Credentials Options (local-dc):
    --local-dc-simple-bind-dn=DN
                        DN to use for a simple bind
    --local-dc-password=PASSWORD
                        Password
    --local-dc-username=USERNAME
                        Username
    --local-dc-workgroup=WORKGROUP
                        Workgroup
    --local-dc-no-pass  Don't ask for a password
    --local-dc-kerberos=KERBEROS
                        Use Kerberos
    --local-dc-ipaddress=IPADDRESS
                        IP address of server
    --local-dc-machine-pass
                        Use stored machine account password

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
3dd3338018 python/samba: add current_unix_time()
This is needed to get the time from modules in python/samba/netcmd/
where a time.py exist.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-07-08 18:38:22 +02:00
Stefan Metzmacher
84993440aa python:samba/tests: don't use the x.alter_context() method in dcerpc/bare.py
Establishing a new context on a given connection using alter_context
is supposed to be done by using y = ClientConnection(..., basis_connection=x)

The current x.alter_context() can work as it's not allowed to
change the abstract or transfer syntax of an existing presentation
context.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
24ea9175f4 python/samba/tests: add fallbacks for assert{Less,Greater}[Equal]()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
c7e9968cf8 python/samba/tests: let the output of hexdump() match our C code in dump_data_cb()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Stefan Metzmacher
7a07f6a764 python/samba/tests: move hexdump() from DNSTest to TestCase
This is useful in a lot of test cases.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2015-07-03 02:00:28 +02:00
Rowland Penny
15f83d80c6 samba-tool: make 'samba-tool fsmo *' aware of all 7 fsmo roles
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10734

Signed-off-by: Rowland Penny <repenny241155@gmail.com>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>

Autobuild-User(master): José A. Rivera <jarrpa@samba.org>
Autobuild-Date(master): Thu Jun 18 10:24:48 CEST 2015 on sn-devel-104
2015-06-18 10:24:48 +02:00
Marc Muehlfeld
9df07e6f1b Group creation: Add msSFU30Name only when --nis-domain was given
This fixes a bug, that all new created groups automatically get an
msSFU30Name attribute added. This should only be the case, when
we also have a nis-domain (samba-tool --nis-domain=...).

Bugreport: https://bugzilla.samba.org/show_bug.cgi?id=11315

Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Christian Ambach <ambi@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Tue Jun 16 11:58:02 CEST 2015 on sn-devel-104
2015-06-16 11:58:02 +02:00
Douglas Bagnall
eef3dab079 KCC: use python 2.6 compatible dictonary comprehensions
The `{k: v for k, v in whatever}` syntax is "new" in Python 2.7.

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 Jun 12 09:46:13 CEST 2015 on sn-devel-104
2015-06-12 09:46:13 +02:00
Douglas Bagnall
bbe90840b9 KCC: intrasite double_directed_ring test shouldn't include RODCs
RODCs don't belong in the ring. In practice, they don't really belong
in the same site as a ring, but that is another matter.

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:17 +02:00
Douglas Bagnall
c45007953b KCC: use logger.critical rather than print >> sys.stderr
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:17 +02:00
Douglas Bagnall
db48fb252f KCC: draw a site-edges graph for each partition
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:17 +02:00
Douglas Bagnall
db4e96ba06 KCC: use KccError, simplify logic in NTDSConn.commit_modified
silence a pep8 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:17 +02:00
Douglas Bagnall
65fb95eda1 KCC: remove unused create_edge_set() function
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:17 +02:00
Douglas Bagnall
dcf582ae31 KCC: ignore the bridges_required option
At least until we have SiteLinkBridges to test against.

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:17 +02:00
Douglas Bagnall
430b0896f2 KCC: fix the polarity of bridges_required option
If one of the *_BRIDGES_REQUIRED flags is set, bridges_required is
True.

We ignore this option anyway.

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:17 +02:00
Douglas Bagnall
229165553a KCC: remove a TODO with seemingly no basis in specification
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:17 +02:00
Douglas Bagnall
534dfb08fb KCC: clarify setup-vertices docstring, remove TODO
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:17 +02:00
Douglas Bagnall
218baa67ca KCC: note about the meaning of None in 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-06-12 06:57:17 +02:00
Douglas Bagnall
957e9b0278 KCC: combine_repl_info() returns the combined replinfo
Previously it returned False if there was no intersections (i.e,
the new repl_info duration was 0). Now the same check can be performed
by checking the duration directly.

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/graph.py
2015-06-12 06:57:17 +02:00
Douglas Bagnall
d662cc7519 KCC: remove unnecessary 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:17 +02:00
Douglas Bagnall
7fc108bcb3 KCC: reword comment, removing unwarranted XXX
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:17 +02:00
Douglas Bagnall
69488c85c1 KCC: remove an unwarranted XXX 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:17 +02:00
Douglas Bagnall
b5a294eb50 KCC: let kcc.graph.ReplInfo know its duration
This is going to lead to a few simplifications.

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:17 +02:00
Douglas Bagnall
27e08cdead KCC: docstring for kcc.graph.InternalEdge
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:17 +02:00
Douglas Bagnall
0f438acd8c KCC: docstring for kcc.graph.MultiEdge
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:17 +02:00
Douglas Bagnall
5a3cb71d0b KCC: docstring for kcc.graph.Vertex
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:16 +02:00
Douglas Bagnall
ea48c8f2b6 KCC: docstring for kcc.graph.VertexColour()
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:16 +02:00
Douglas Bagnall
7663951112 KCC: docstring for kcc.graph.setup_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:16 +02:00
Douglas Bagnall
2331161a4a KCC: docstring for kcc.graph.add_edge_out()
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:16 +02:00
Douglas Bagnall
3a5a516ce3 KCC: docstring for kcc.graph.find_component()
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:16 +02:00
Douglas Bagnall
f019fea947 KCC: some rearrangement in kcc.graph.add_int_edge()
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:16 +02:00
Douglas Bagnall
6c760c1a0d KCC: docstring for kcc.graph.kruskal()
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:16 +02:00
Douglas Bagnall
84fb4afe87 KCC: docstring for kcc.graph.add_int_edge()
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:16 +02:00
Douglas Bagnall
61c1d8ad39 KCC: docstring for kcc.graph.process_edge()
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:16 +02:00
Douglas Bagnall
a75b874902 KCC: docstring for kcc.graph.process_edge_set()
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:16 +02:00
Douglas Bagnall
7c62a85851 KCC: docstring for kcc.graph.undemote_vertex()
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:16 +02:00
Douglas Bagnall
90aa7f12e1 KCC: docstring for kcc.graph.check_demote_vertex()
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:16 +02:00
Douglas Bagnall
490eb10023 KCC: pep8 line length in 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:16 +02:00
Douglas Bagnall
5ea0dfb46f KCC: pep8 -- remove an extra line in 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-06-12 06:57:16 +02:00
Douglas Bagnall
f3600102ea KCC: pep8 remove a line
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:16 +02:00
Douglas Bagnall
316fa2ee8a KCC: samba.kcc formatting fixes for pep8
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:16 +02:00
Douglas Bagnall
68a0f131fb KCC: remove XXX scare comments around guid comparisons.
The guid comparisons are settled. We use ndrpack.

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:16 +02:00
Douglas Bagnall
af1a307f8d KCC: setup_dijkstra() creates its own empty queue
It needs to operate on an empty list, which is something the caller
really shouldn't have to worry about.

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:16 +02:00
Douglas Bagnall
4a9b9b23f0 KCC: Add graph.InternalEdge.__lt__ docstring
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:16 +02:00
Douglas Bagnall
b59666c36d KCC: Add graph.try_new_path docstring
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:16 +02:00
Douglas Bagnall
3069fba6e5 KCC: Add graph.dijkstra and setup_dijkstra() docstrings
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:16 +02:00
Douglas Bagnall
a0fea23811 KCC: Add graph.setup_vertices() docstring
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:16 +02:00
Douglas Bagnall
aeda7f4c61 KCC: don't pretend graph.create_edge_set() is useful
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
a49cd69642 KCC: Add s.k.g.create_auto_edge_set() docstring, improve variable name
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
f86620edc7 KCC: Add samba.kcc.graph.create_edge() docstring
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
86004daff5 KCC: improve samba.kcc.graph.get_spanning_tree_edges() docstring
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
79f2c71709 KCC: Add ReplInfo docstring
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
99f07fa695 KCC: use logger functions rather than print in 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
56b7b157a8 KCC: ldif_import_export tests dotfiles have contents
This is regardless of whether validation is available via /usr/bin/dot -Tcanon

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
33e82b88b6 KCC: ldif_import_export tests checks the dot-files
if /usr/bin/dot exists,  the files should be checked for validity.

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
746c67c527 KCC: ldif_import_export tests use samba.tests.TestCaseInTempDir
Rather than making their own tempdirs.

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
310250935e KCC: add tests for kcc.graph repltimes functions
There used to be bugs in these.

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
751726c02d KCC: beginning of tests for kcc.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:15 +02:00
Douglas Bagnall
9f33d91ee7 KCC: add a very puny stub for kcc.kcc_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
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
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