[PATCH] Fix dn+binary linked attribute behavior (bug 11139)

Bob Campbell bobcampbell at catalyst.net.nz
Wed Feb 1 00:36:22 UTC 2017


Hi Andrew,

Attached are some revised patches. The changes are that the linkID
duplicate check is now in the samldb module as you mentioned, and there
is also now a test for making sure that we can't add links with
duplicate linkIDs (unless the linkID is 0).

Thanks,
Bob


On 27/01/17 19:24, Andrew Bartlett wrote:
> On Thu, 2017-01-26 at 16:25 +1300, Bob Campbell wrote:
>> Hi,
>>
>> The test would fail if run twice in a row, and so didn't make it past
>> autobuild. This was due to there being colliding linkIDs, which
>> messes
>> up the deletion of backlinks. 
> Nice find!
>
>> Here's a new patchset which includes a
>> patch to disallow attributes with duplicate linkIDs to be added,
>> unless
>> DSDB_CONTROL_SKIP_DUPLICATES_CHECK_OID is set. The test has also been
>> changed slightly to find a non-duplicate linkID.
> I rather expected the check to be like the OID checks in the samldb
> module.  I'm concerned that the loaded schema may also not be current,
> and so I think we should instead search the DB for the duplicate linkID
> (or perhaps the loaded schema is always current enough these days). 
>
> Thanks,
>
> Andrew Bartlett
>
>> Please review and push if appropriate.
>>
>> Thanks,
>> Bob
>>
>>
>> On 06/01/17 11:19, Douglas Bagnall wrote:
>>> hi Bob,
>>>
>>> On 06/01/17 09:44, Bob Campbell wrote:
>>>> Hi Douglas,
>>>>
>>>> Thanks for having a look at this.
>>>> Attached are patches with these issues fixed.
>>> Good! RB+.
>>>
>>> Douglas
>>>
>>>
>>>> Thanks,
>>>> Bob
>>>>
>>>> On 05/01/17 17:05, Douglas Bagnall wrote:
>>>>> hi Bob,
>>>>>
>>>>> I see a couple of superficial issues.
>>>>>>  
>>>>>> +import os
>>>>> You don't actually use this.
>>>>>
>>>>>> @@ -37,12 +40,11 @@ from ldb import (
>>>>>>      Message,
>>>>>>      FLAG_MOD_ADD,
>>>>>>      FLAG_MOD_REPLACE,
>>>>>> +    FLAG_MOD_DELETE
>>>>>>      )
>>>>> or this.
>>>>>
>>>>>> +
>>>>>> +        link_end_dn = ldb.Dn(self.ldb_dc1, "OU=test_ou,%s" %
>>>>>> str(self.ldb_dc1.get_default_basedn()))
>>>>> here the line length is getting a bit out of control and the
>>>>> str() is
>>>>> redundant (because "%s" implies str()). There are other
>>>>> instances of that.
>>>>>
>>>>>> +
>>>>>> +        self._net_drs_replicate(DC=self.dnsname_dc2,
>>>>>> fromDC=self.dnsname_dc1, nc_dn=self.schema_dn, forced=True)
>>>>>> +        self._net_drs_replicate(DC=self.dnsname_dc2,
>>>>>> fromDC=self.dnsname_dc1, nc_dn=self.domain_dn, forced=True)
>>>>>> +
>>>>> and line length again.
>>>>>
>>>>>> From 0a1a65c99e6b8ec39ad0c7018e05759343899e51 Mon Sep 17
>>>>>> 00:00:00 2001
>>>>>> From: Andrew Bartlett <abartlet at samba.org>
>>>>>> Date: Mon, 12 Oct 2015 15:51:37 +1300
>>>>>> Subject: [PATCH 2/2] repl_meta_data: Remove the correct
>>>>>> linked attribute
>>>>>>  forward link
>>>>> This one looks good.
>>>>>
>>>>> cheers,
>>>>> Douglas
>>>>>
>>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-repl_meta_data-Remove-the-correct-linked-attribute-f.patch
Type: text/x-patch
Size: 6839 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170201/f2376df4/0004-repl_meta_data-Remove-the-correct-linked-attribute-f.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-torture-drs-Add-a-test-for-dn-binary-linked-attribut.patch
Type: text/x-patch
Size: 8939 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170201/f2376df4/0003-torture-drs-Add-a-test-for-dn-binary-linked-attribut.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-samldb-Prevent-duplicate-linkID-in-schema.patch
Type: text/x-patch
Size: 2666 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170201/f2376df4/0002-samldb-Prevent-duplicate-linkID-in-schema.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-python-tests-add-test-for-duplicate-linkID.patch
Type: text/x-patch
Size: 4174 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20170201/f2376df4/0001-python-tests-add-test-for-duplicate-linkID.bin>


More information about the samba-technical mailing list