summaryrefslogtreecommitdiff
path: root/python
Commit message (Collapse)AuthorAgeFilesLines
* selftest: Make setexpiry test much more reliableAndrew Bartlett2019-04-021-3/+2
| | | | | | | | | | | | | | | | | | | | Rather than setting all the expiries and expecting that they will be done within 5 seconds, measure and check the time individually for each record. This should make this test much less prone to flapping. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13867 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue May 15 23:58:17 CEST 2018 on sn-devel-144 (cherry picked from commit 5ebe3183fded1ab060ed60baeedeac859d0c137e) Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Tue Apr 2 15:16:10 UTC 2019 on sn-devel-144
* dbcheck: use the str() value of the "name" attributeStefan Metzmacher2019-03-281-1/+1
| | | | | | | | | | | | We do the same with the rdn attribute value and we need the same logic on both in order to check they are the same. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Noel Power <npower@samba.org> (cherry picked from commit dd6f0dad218ec1d5aa38ea8aa6848ec81035cb3f)
* dbcheck: don't check expired tombstone objects by default anymoreStefan Metzmacher2019-03-282-3/+48
| | | | | | | | | | | | | | | These will be removed anyway and any change on them risks to be an originating update that causes replication problems. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Mar 14 03:12:27 UTC 2019 on sn-devel-144 (cherry picked from commit a2c5f8cf41c2dfdc4f122e8427d1dfeabb6ba311)
* dbcheck: add --selftest-check-expired-tombstones cmdline optionStefan Metzmacher2019-03-281-2/+7
| | | | | | | | | This will be used by dbcheck tests which operate on static/old provision dumps in the following commits. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 6f9c5ed8de47bb98e21e8064d8e90f963f2f71ca)
* python/samba/netcmd: provide SUPPRESS_HELP via Option classStefan Metzmacher2019-03-281-0/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit b61d580fb7dba8ff94e9e98c958e324865cd2f1d)
* dbcheck: detect the change after deletion bugStefan Metzmacher2019-03-281-0/+109
| | | | | | | | | | | | | | | | | | | | | | | Old versions of 'samba-tool dbcheck' could reanimate deleted objects, when running at the same time as the tombstone garbage collection. When the (deleted) parent of a deleted object (with the DISALLOW_MOVE_ON_DELETE bit in systemFlags), is removed before the object itself, dbcheck moved it in the LostAndFound[Config] subtree of the partition as an originating change. That means that the object will be in tombstone state again for 180 days on the local DC. And other DCs fail to replicate the object as it's already removed completely there and the replication only gives the name and lastKnownParent attributes, because all other attributes should already be known to the other DC. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit a1658b306d85452407388b91a745078c9c1f7dc7)
* dbcheck: add find_repl_attid() helper functionStefan Metzmacher2019-03-281-6/+9
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 598e38d2a5e0832429ba65b4e55bf7127618f894)
* dbcheck: don't remove dangling one-way links on already deleted objectsStefan Metzmacher2019-03-281-0/+13
| | | | | | | | | | | | | | | This would typically happen when the garbage collection removed a parent object before a child object (both with the DISALLOW_MOVE_ON_DELETE bit set in systemFlags), while dbcheck is running at the same time as the garbage collection. In this case the lastKnownParent attributes points a non existing object. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit e388e599495b6d7c38b8b6966332e27f8b958783)
* dbcheck: don't move already deleted objects to LostAndFoundStefan Metzmacher2019-03-281-2/+7
| | | | | | | | | | | | | This would typically happen when the garbage collection removed a parent object before a child object (both with the DISALLOW_MOVE_ON_DELETE bit set in systemFlags), while dbcheck is running at the same time as the garbage collection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 6d50ee74920c39cdb18b427bfaaf200775bf2d73)
* dbcheck: do isDeleted, systemFlags and replPropertyMetaData detection firstStefan Metzmacher2019-03-281-11/+14
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 9afcd5331ce567bd80d35175f8e4e21c506e9347)
* dbcheck: use DSDB_CONTROL_DBCHECK_FIX_LINK_DN_NAME when renaming deleted objectsStefan Metzmacher2019-03-281-3/+6
| | | | | | | | | | We should never do originating updates on deleted objects. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 07a8326746f0c444eedf3860b178fc29d84e8d16)
* python/samba: extra ndr_unpack needs bytes functionNoel Power2019-03-281-1/+1
| | | | (cherry picked from commit 8db43696e70d7c4cb21172b7e7461cf6a72914a2)
* python/samba: PY3 port for ridalloc_exop test to workNoel Power2019-03-282-7/+6
| | | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit fc13a1268a4a9de94efd312a8309aa55d331ae19)
* netcmd/user: python[3]-gpgme unsupported and replaced by python[3]-gpgJoe Guo2019-02-211-24/+61
| | | | | | | | | | | | | python[3]-gpgme is deprecated since ubuntu 1804 and debian 9. use python[3]-gpg instead, and adapt the API. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13728 Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 84069c8a5476a47d45ab946d82abb0d6c04635c3)
* join: Throw CommandError instead of Exception for simple errorsTim Beale2019-02-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | Throwing an exception here still dumps out the Python stack trace, which can be a little disconcerting for users. In this case, the stack trace isn't going to really help at all (the problem is pretty obvious), and it obscures the useful message explaining what went wrong. Throw a CommandError instead, which samba-tool will catch and display more nicely. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13747 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Rowland Penny <rpenny@samba.org> Reviewed-by: Jeremy Allison <rpenny@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 16 22:11:04 CET 2019 on sn-devel-144 (cherry picked from commit 9e4b08f4c384b8cae5ad853a7be7cf03e2749be5)
* join: Fix TypeError when handling exceptionTim Beale2019-02-052-3/+3
| | | | | | | | | | | | | | | | | | | | | | When we can't resolve a domain name, we were inadvertently throwing a TypeError whilst trying to output a helpful message. E.g. ERROR(<class 'TypeError'>): uncaught exception - 'NTSTATUSError' object does not support indexing Instead of indexing the object, we want to index the Exception.args so that we just display the string portion of the exception error. The same problem is also present for the domain trust commands. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13747 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Rowland Penny <rpenny@samba.org> Reviewed-by: Jeremy Allison <rpenny@samba.org> (cherry picked from commit 3bb7808984c163a7bba66fb983411d1281589722 and modified to work for 4.8 - note that the NTSTATUSError exception wasn't even imported on 4.8)
* CVE-2018-14629: Tests to expose regression from dns cname loop fixAaron Haslett2018-12-071-0/+100
| | | | | | | | | | | These tests expose the regression described by Stefan Metzmacher in discussion on the bugzilla paged linked below. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13600 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 14399fd818b130a6347eec860460929c292d5996)
* Merge tag 'samba-4.8.7' into v4-8-testKarolin Seeger2018-11-271-0/+24
|\ | | | | | | samba: tag release samba-4.8.7
| * CVE-2018-14629 dns: CNAME loop prevention using counterAaron Haslett2018-11-261-0/+24
| | | | | | | | | | | | | | | | | | | | | | Count number of answers generated by internal DNS query routine and stop at 20 to match Microsoft's loop prevention mechanism. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13600 Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* | dbchecker: Fix missing <SID=...> on linked attributesStefan Metzmacher2018-11-051-1/+41
| | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13418 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit a801799ebe26780653f4ed3fa3fc633e31871f7d)
* | dbchecker: improve verbose output of do_modify()Stefan Metzmacher2018-11-051-1/+2
| | | | | | | | | | | | | | | | | | | | This makes it easier to debug dbcheck problems. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13418 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit c5c99b569569ce36cac94e967ca53e3182abd6f7)
* | dbchecker: Fixing up incorrect DNs wasn't workingTim Beale2018-11-051-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbcheck would fail to fix up attributes where the extended DN's GUID is correct, but the DN itself is incorrect. The code failed attempting to remove the old/incorrect DN, e.g. NOTE: old (due to rename or delete) DN string component for objectCategory in object CN=alice,CN=Users,DC=samba,DC=example,DC=com - <GUID=7bfdf9d8-62f9-420c-8a71-e3d3e931c91e>; CN=Person,CN=Schema,CN=Configuration,DC=samba,DC=bad,DC=com Change DN to <GUID=7bfdf9d8-62f9-420c-8a71-e3d3e931c91e>; CN=Person,CN=Schema,CN=Configuration,DC=samba,DC=example,DC=com? [y/N/all/none] y Failed to fix old DN string on attribute objectCategory : (16, "attribute 'objectCategory': no matching attribute value while deleting attribute on 'CN=alice,CN=Users,DC=samba,DC=example,DC=com'") The problem was the LDB message specified the value to delete with its full DN, including the GUID. The LDB code then helpfully corrected this value on the way through, so that the DN got updated to reflect the correct DN (i.e. 'DC=example,DC=com') of the object matching that GUID, rather than the incorrect DN (i.e. 'DC=bad,DC=com') that we were trying to remove. Because the requested value and the existing DB value didn't match, the operation failed. We can avoid this problem by passing down just the DN (not the extended DN) of the value we want to delete. Without the GUID portion of the DN, the LDB code will no longer try to correct it on the way through, and the dbcheck operation will succeed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13495 Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Pair-programmed-with: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 22208f52e6096fbe9413b8ff339d9446851e0874)
* | dbcheck: Use symbolic control name for DSDB_CONTROL_DBCHECK_FIX_DUPLICATE_LINKSAndrew Bartlett2018-11-051-1/+1
| | | | | | | | | | | | | | | | | | While we do not wish to encourage use of this control, manually typed OIDs are even more trouble, so pass out via pydsdb. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> (cherry picked from commit c7fd68088d84232a2f4074ca278b5448ef624afd)
* | test:doc: Skip 'clustering=yes'Christof Schmitt2018-10-091-1/+2
|/ | | | | | | | | | | As testparm will error out when running clustering=yes as non-root, skip this step to avoid a test failure. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (backported from commit 3ecb9ed7b079fc1bf74c311cf5f1684086b36883)
* samba-tool: add virtualKerberosSalt attribute to 'user ↵Stefan Metzmacher2018-09-051-0/+24
| | | | | | | | | | | | | getpassword/syncpasswords' This might be useful for someone, but at least it's very useful for tests. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13539 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 39c281a23673691bab621de1a632d64df2c1c102)
* Merge tag 'samba-4.8.4' into v4-8-testKarolin Seeger2018-08-141-0/+87
|\ | | | | | | samba: tag release samba-4.8.4
| * CVE-2018-1140 dns: Add a test to trigger the LDB casefolding issue on ↵Kai Blin2018-08-111-0/+87
| | | | | | | | | | | | | | | | | | invalid chars BUG: https://bugzilla.samba.org/show_bug.cgi?id=13466 Signed-off-by: Kai Blin <kai@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* | dns wildcards: tests to confirm BUG 13536Gary Lockyer2018-08-131-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | DNS wildcard matching failing if more than one label to the left of the wildcard. This commits adds tests to confirm the bug. Wildcard entry: *.example.org bar.example.com matches foo.bar.example.com does not, but it it should. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 0d3aec18679a2637430263a55de5e210a9201e21)
* | samba-tool trust: support discovery via netr_GetDcNameAlexander Bokovoy2018-08-131-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case a remote DC does not support netr_DsRGetDCNameEx2(), use netr_GetDcName() instead. This should help with FreeIPA where embedded smbd runs as a domain controller but does not implement full Active Directory compatibility. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13538 Signed-off-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Tue Jul 24 09:55:23 CEST 2018 on sn-devel-144 (cherry picked from commit c390728819e73cefbf02e0d52d22805930f4c45b)
* | python/tests: use explicit "client ipc max protocol = NT1" for ↵Stefan Metzmacher2018-08-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | samba.tests.net_join_no_spnego The tests rely on SMB1. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> (cherry picked from commit 802e43bf742e756896fa73fcd139feca9ae293dd)
* | tests/auth_log: Permit SMB2 service description if empty binding is used for ↵Alexander Bokovoy2018-08-131-9/+19
|/ | | | | | | | | | | | kerberos authentication BUG: https://bugzilla.samba.org/show_bug.cgi?id=13308 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Alexander Bokovoy <ab@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 70a9cf9ccfc4075cc08209191db1bce2c9b432fc)
* ms_schema: fix python2.6 incompatibilityBjörn Baumbach2018-04-101-1/+1
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13337 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> (cherry picked from commit a27db0b61e40b6b503b53e3579867e227f1971b8)
* samba-tool visualize: fix python2.6 incompatibilityBjörn Baumbach2018-04-101-1/+5
| | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13337 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Wed Mar 21 09:25:51 CET 2018 on sn-devel-144 (cherry picked from commit 9312a1cdafbd5a0140d72502487c4e478dc578d2)
* tests/py_creds: Add a SamLogonEx test with an empty string domainGarming Sam2018-02-271-0/+27
| | | | | | | | | | | This test passes against 4.6, but failed against 4.7.5 and master. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13206 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 5c625eae3f54e8de434de26e9f6a0f2fde557c18)
* tests:dcerpc/raw_protocol: reproduce call_id truncation bugStefan Metzmacher2018-02-271-1/+1
| | | | | | | | | | We need to make sure the server handles call_id values > UINT16_MAX. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13289 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 65e8edb382fbc7450919aad8b42cfcae9e779d11)
* provision: fix the 'dnsdomain' for the local sam of a domain memberStefan Metzmacher2018-02-271-0/+16
| | | | | | | | | | | A member has a local AD database, which should not use the 'dnsdomain' as the one on domain controllers. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13285 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit b02de5ad3e04babe1565868c69422cfc778458d9)
* traffic_packets.py: let Lookup{Sids,Names}() work against a sane serverStefan Metzmacher2018-02-271-8/+8
| | | | | | | | | | | In order to resolve predefined sids or names we need to use level = LSA_LOOKUP_NAMES_ALL (1). Bug: https://bugzilla.samba.org/show_bug.cgi?id=13284 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 1a258b6b0f667ec077639a7cfe826e5e25f46768)
* subnet: Avoid a segfault when renaming subnet objectsGarming Sam2018-02-201-0/+33
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13031 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(v4-8-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-8-test): Tue Feb 20 17:54:43 CET 2018 on sn-devel-144
* dbcheck: skip find_missing_forward_links_from_backlinks() if the db has the ↵Stefan Metzmacher2018-02-091-0/+25
| | | | | | | | | | | | | | sortedLinks feature BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 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): Mon Feb 5 18:32:51 CET 2018 on sn-devel-144 (cherry picked from commit 0c3348feb09f4f0ba85455b8c3ff5c5fa60d139b)
* dbcheck: add support for restoring missing forward linksRalph Boehme2018-02-091-6/+37
| | | | | | | | | | | | | | | | This recovers broken databases with duplicate and missing forward links. See commit a25c99c9f1fd1814c56c21848c748cd0e038eed7 for the fix that prevents to problem from happening. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 5bf823d68bd33ee3160175a18a3838eff4e3cbb2)
* dbcheck: add find_missing_forward_links_from_backlinks()Ralph Boehme2018-02-091-0/+96
| | | | | | | | | | | | | | | | | find_missing_forward_links_from_backlinks() finds and returns missing forward-links by searching all for all objects that link to the object in the backlink attribute. This will be used in the next commit to restore forward links in a corrupted forward link attribute by passing the missing backling objects to err_recover_forward_links(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit d59f201388e8a16688adda145734dab8e27b785f)
* dbcheck: make sure we ask for replPropertyMetaData if we need to process any ↵Stefan Metzmacher2018-02-091-0/+12
| | | | | | | | | | forward link attributes BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 182fb3c4c9db8715d0dbcbc3d1aa0655b5cb29f1)
* dbcheck: make sure we always ask for the objectGUID attribute explicitlyStefan Metzmacher2018-02-091-2/+1
| | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 20598033866ca3d0fdad1edf3cb39e4614eae112)
* dbcheck: add a helper function that checks is a value has duplicate linksRalph Boehme2018-02-091-0/+32
| | | | | | | | | | | | Will be used in a subsequent commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit e258b4fb281d8577c425e05b35ce05cf128617ea)
* dbcheck: add a dict where we remember attributes with duplicate linksRalph Boehme2018-02-091-0/+7
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit e4cc062fa98f65369f3bde24a987c2651632cb06)
* dbcheck: split out check_duplicate_links from check_dnRalph Boehme2018-02-091-16/+29
| | | | | | | | | | | | Refactoring, no change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit 44a8782d71676517f0991f279f2472391ecede3b)
* dbcheck: store fixed forward link attributes with the correct sortingStefan Metzmacher2018-02-091-11/+6
| | | | | | | | | | | The corruption we're trying to fix messed up the sorting, so there's no point in keeping the current order. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit 7df17c0a8dffceb053ca806c9426d493b4837b1a)
* dbcheck: remove ldb.FLAG_MOD_REPLACE when replacing search results for ↵Stefan Metzmacher2018-02-091-1/+1
| | | | | | | | | | | | forward links Search results don't have an ldb.FLAG_MOD_* flags set. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> (cherry picked from commit b0bc3f60084e5998dd34aada2ac7377d390affc6)
* dbcheck: rename err_duplicate_links() to err_recover_forward_links() and ↵Ralph Boehme2018-02-091-5/+8
| | | | | | | | | | | | | | | adjust the output message It's really a fatal error to have duplicate values as it's very likely that some forward links got lost. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit ec433f8531a822dd40b343fbf3244157a5ecd544)
* dbcheck: add link direction to error message for duplicate linksRalph Boehme2018-02-091-1/+2
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13228 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit dc43d31cd20fd12d2758b73ec0318215b8fbedfb)