summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb/ldb_index.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-08-16 11:03:58 +1000
committerAndrew Tridgell <tridge@samba.org>2010-08-17 08:44:28 +1000
commitfd59a7c4affdd1a6c6fe7caf29264acabcd0c03e (patch)
tree2f46e07a515d7dbce1fbdea7629ffb962699bc24 /source4/lib/ldb/ldb_tdb/ldb_index.c
parent1cc471d69fc6ff5dc835462b712645415f8feca4 (diff)
downloadsamba-fd59a7c4affdd1a6c6fe7caf29264acabcd0c03e.tar.gz
samba-fd59a7c4affdd1a6c6fe7caf29264acabcd0c03e.tar.bz2
samba-fd59a7c4affdd1a6c6fe7caf29264acabcd0c03e.zip
s4-ldb: fixed the ldb 'displayName=a,b' indexing bug
the problem was the inconsistency between the key form of DNs between the itdb used for indexing and the on disk form Thanks to Matthieu Patou for finding this bug! Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_index.c')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 4f5979877b..a39e6c7097 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -1446,8 +1446,10 @@ static int delete_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, vo
* index entry */
list.dn = NULL;
list.count = 0;
- v.data = key.dptr;
- v.length = strnlen((char *)key.dptr, key.dsize);
+
+ /* the offset of 3 is to remove the DN= prefix. */
+ v.data = key.dptr + 3;
+ v.length = strnlen((char *)key.dptr, key.dsize) - 3;
dn = ldb_dn_from_ldb_val(ltdb, ldb_module_get_ctx(module), &v);
ret = ltdb_dn_list_store(module, dn, &list);