[PATCH] ldb: Compare the DNs in consideration of the tree structure.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] ldb: Compare the DNs in consideration of the tree structure.

Samba - samba-technical mailing list
Hi!

Please find a patch attached which improves the comparison of DNs, which
can be used to sort DNs in a convenient way.

Please review and push.

Thanks,
Björn

--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:[hidden email]

0001-ldb-Compare-the-DNs-in-consideration-of-the-tree-str.patch (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] ldb: Compare the DNs in consideration of the tree structure.

Samba - samba-technical mailing list
On Thu, 2017-12-07 at 15:02 +0100, Bjoern Baumbach via samba-technical
wrote:
> Hi!
>
> Please find a patch attached which improves the comparison of DNs, which
> can be used to sort DNs in a convenient way.
>
> Please review and push.

I understand the motivation here, however I'm concerned about the cost.

In particular, this makes changes such that LDB will look up the schema
and re-calculate the comparison rather than use the casefolded value.  

I'm quite concerned that, on a large database, this could be quite
significant.

Likewise, you seem to change the strcmp() on the casefolded attribute
name to be a strcasecmp() (under the guise of ldb_attr_cmp()), this is
simply wasteful.

I appreciate your motivations here, however I don't think this can go
in as-is.  It may be that we need to separate the callers that desire
structured equality from those that simply desire equal/not-equal.

Sorry,

Andrew Bartlett
--
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba


Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] ldb: Compare the DNs in consideration of the tree structure.

Samba - samba-technical mailing list
On 12/07/2017 07:11 PM, Andrew Bartlett wrote:

> On Thu, 2017-12-07 at 15:02 +0100, Bjoern Baumbach via samba-technical
> wrote:
>> Hi!
>>
>> Please find a patch attached which improves the comparison of DNs, which
>> can be used to sort DNs in a convenient way.
>>
>> Please review and push.
> I understand the motivation here, however I'm concerned about the cost.
>
> In particular, this makes changes such that LDB will look up the schema
> and re-calculate the comparison rather than use the casefolded value.  
>
> I'm quite concerned that, on a large database, this could be quite
> significant.
>
> Likewise, you seem to change the strcmp() on the casefolded attribute
> name to be a strcasecmp() (under the guise of ldb_attr_cmp()), this is
> simply wasteful.
>
> I appreciate your motivations here, however I don't think this can go
> in as-is.  It may be that we need to separate the callers that desire
> structured equality from those that simply desire equal/not-equal.

Hi Andrew,

thank you for the review. I see your doubts.

I'am currenly implementing a samba-tool subcommand for the OU management
which includes a 'list' command. I thought it would be nice to get a
well-ordered list of DNs.
I'll add the suggested compare function in the python OU management
code, now.

Best regards,
Björn

--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:[hidden email]