ldb_tdb: Make sure max_key_length != 0 requires a GUID index mode
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 6 Mar 2018 02:27:51 +0000 (15:27 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 3 May 2018 06:17:44 +0000 (08:17 +0200)
commit705cf715f9015e879bb7fe712fffe3a69b805aad
treeee3cfa270ee84222f535930929159dd78d90b74f
parente48bd332dc05d05a0b1e64106a9266d1c5a591f6
ldb_tdb: Make sure max_key_length != 0 requires a GUID index mode

We need to enforce the GUID index mode so end-users do not get a supprise
in mid-operation and we enforce a max key length of 511 so that the
index key trunctation is done correctly.

Otherwise the DB will appear to work until a very long key (DN or index)
is used, after which it will be sad.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/ldb/ldb_tdb/ldb_tdb.c