1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/testprogs/blackbox
Tim Beale 22208f52e6 dbchecker: Fixing up incorrect DNs wasn't working
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>
2018-07-03 05:24:13 +02:00
..
wintest
bogus.sh testprogs: Fix usage printout of bogus blackbox test 2017-04-29 23:31:10 +02:00
common_test_fns.inc testprogs: Return the correct error status code 2018-03-03 00:01:23 +01:00
common-links.sh selftest: Add more corruption cases for runtime and dbcheck 2017-11-24 15:50:16 +01:00
dbcheck-links.sh dbchecker: Fixing up incorrect DNs wasn't working 2018-07-03 05:24:13 +02:00
dbcheck-oldrelease.sh Remove some bashisms from the test scripts 2018-03-01 09:53:45 +01:00
dbcheck.sh replmd: Try to add forward-link for unknown cross-partition links 2017-08-18 06:07:12 +02:00
demote-saveddb.sh selftest: Confirm a demote of a real network works 2015-10-26 08:17:47 +01:00
dfree.sh selftest: more dfree command and smbclient disk usage tests 2016-01-06 03:58:59 +01:00
dom_parse.sh Add a blackbox tests for id & getent to test domain@realm type credentials 2016-10-03 19:49:19 +02:00
functionalprep.sh functionalprep.sh: Add a test to show that functional prep works on old databases 2017-12-20 23:13:12 +01:00
nsstest.sh s4-selftest re-enable nsstest on libnss_winbind.so 2011-12-07 03:09:08 +01:00
renamedc.sh dbcheck: Do not regard old one-way-links as errors 2017-02-13 03:39:23 +01:00
runtime-links.sh selftest: Add more corruption cases for runtime and dbcheck 2017-11-24 15:50:16 +01:00
schemaupgrade.sh provision: Use the official MS 2008R2 schema by default 2017-12-14 08:20:17 +01:00
subunit.sh testprogs: Ignore escape characters when printing test name 2017-05-05 23:44:16 +02:00
test_chgdcpass.sh selftest: Align cleanup of tmpkpasswdscript with scripts that use it 2018-03-23 02:32:08 +01:00
test_client_etypes.sh testprogs: Use own credential cache for test_client_etypes.sh 2016-09-25 09:05:27 +02:00
test_export_keytab_heimdal.sh selfttest: add common_test_fns.inc 2016-04-28 16:50:35 +02:00
test_export_keytab_mit.sh testprogs: Add test with exported keytab from samba-tool 2017-04-29 23:31:10 +02:00
test_kinit_heimdal.sh netcmd: Split 'domain passwordsettings' into a super-command 2018-05-11 06:01:24 +02:00
test_kinit_mit.sh netcmd: Split 'domain passwordsettings' into a super-command 2018-05-11 06:01:24 +02:00
test_kinit_trusts_heimdal.sh selftest: Align cleanup of tmpkpasswdscript with scripts that use it 2018-03-23 02:32:08 +01:00
test_kinit_trusts_mit.sh testprogs: Add a kinit trust test for MIT KDC 2017-04-29 23:31:10 +02:00
test_kpasswd_heimdal.sh netcmd: Split 'domain passwordsettings' into a super-command 2018-05-11 06:01:24 +02:00
test_kpasswd_mit.sh netcmd: Split 'domain passwordsettings' into a super-command 2018-05-11 06:01:24 +02:00
test_ktpass.sh testprogs: Do not use the deprecated samba-tool user add 2016-07-07 02:15:16 +02:00
test_ldb_simple.sh CVE-2016-2112: s4:selftest: run some ldap test against ad_dc_ntvfs, fl2008r2dc and fl2003dc 2016-04-12 19:25:25 +02:00
test_ldb.sh lib/tls: Change default supported TLS versions. 2015-07-20 03:08:26 +02:00
test_net_ads_dns.sh testprogs/blackbox: don't use hardcoded values in test_net_ads_dns.sh 2017-06-13 22:46:14 +02:00
test_net_ads.sh testprogs: 'net ads keytab create' expected failures should now pass 2018-03-02 14:07:15 +01:00
test_net_rpc_user.sh testprogs: Add 'net rpc user' test against AD DC 2017-05-11 20:30:12 +02:00
test_password_settings.sh testprogs/blackbox: Add test to set and use password with non-ascii 2018-05-17 11:31:28 +02:00
test_pdbtest.sh selfttest: add common_test_fns.inc 2016-04-28 16:50:35 +02:00
test_pkinit_heimdal.sh test_pkinit_heimdal.sh: add some more tests regarding the UF_SMARTCARD_REQUIRED behavior 2016-07-22 23:34:21 +02:00
test_pkinit_pac_heimdal.sh testprogs/blackbox: add test_pkinit_pac_heimdal.sh 2016-07-22 23:34:21 +02:00
test_samba_upgradedns.sh testprogs: Use the system binaries for KRB5 if we don't build in-tree heimdal. 2014-09-01 15:47:33 +02:00
test_trust_ntlm.sh test_trust_ntlm.sh: add lookup name tests 2018-02-21 14:19:19 +01:00
test_trust_token.sh testprogs/blackbox: add test_trust_token.sh 2018-03-19 20:30:51 +01:00
test_trust_utils.sh testprogs/blackbox: add test_trust_utils.sh 2015-07-08 18:38:22 +02:00
test_wintest.sh Remove some bashisms from the test scripts 2018-02-19 07:36:23 +01:00
tfork.sh lib/util: add a test for samba_runcmd_send() 2017-04-20 16:53:16 +02:00
tombstones-expunge.sh testprogs:blackbox: add regression test for unsorted links in tombstones-expunge.sh 2018-01-22 12:26:19 +01:00
upgradeprovision-oldrelease.sh upgradeprovision: Mark tests as passing again (using functional prep) 2017-12-20 23:13:12 +01:00