[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,
					*key_val,
ldb_val_equal_exact_ordered,
					exact, next);
		if (exact != NULL) {
			talloc_free(list);
			return LDB_ERR_OPERATIONS_ERROR;
		}

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
cn:
foo000000000000000000000001

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.

Thanks!

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







More information about the samba-technical mailing list