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

Bjoern Baumbach bb at sernet.de
Fri Dec 8 10:48:55 UTC 2017


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:kontakt at sernet.de



More information about the samba-technical mailing list