diff options
Diffstat (limited to 'source4/lib/ldb/ldb_tdb/ldb_index.c')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_index.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index 6c21ae2986..76e17cdfd5 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -590,6 +590,14 @@ static int ltdb_index_add1_add(struct ldb_context *ldb, char *dn) { struct ldb_val *v2; + int i; + + /* for multi-valued attributes we can end up with repeats */ + for (i=0;i<msg->elements[idx].num_values;i++) { + if (strcmp(dn, msg->elements[idx].values[i].data) == 0) { + return 0; + } + } v2 = realloc_p(msg->elements[idx].values, struct ldb_val, |