[PATCH] Changes to indexing to handle maximum key lengths.

Andrew Bartlett abartlet at samba.org
Tue Feb 27 04:20:57 UTC 2018

On Tue, 2018-02-27 at 13:08 +1300, Gary Lockyer wrote:
> Updated patch set attached.

Thanks Gary.

In ltdb_index_add1():

		BINARY_ARRAY_SEARCH_GTE(list->dn, list->count,
					exact, next);
		if (exact != NULL) {

I'm concerned about multi-valued, not-unique indexed attributes.

This will fail if you get a entry like:

dn: dc=foo,dc=com
cn: foo000000000000000000000000

additionally, when modified to then be:

dn: dc=foo,dc=com
cn: foo000000000000000000000000

The filters still need to match, and note delete the last index entry
for the record.  Naturally also just check the index record now you
have that functionality. 

Garming also wanted some clear comments where you don't pass the
*truncation further up the stack and why that is (currently) safe. 

Finally, where we do the loop and DN compare, we need a comment on the
ldb_dn_compare() as this, not everything above it, is the critical step
in the loop. 

We are getting there.  This will unblock the LMDB work and be really
good, as long as we work out these corner cases.


Andrew Bartlett
Andrew Bartlett
Authentication Developer, Samba Team         https://samba.org
Samba Development and Support, Catalyst IT   

More information about the samba-technical mailing list