ldb_tdb: Do not give the warning of duplicate attributes in truncation
authorGary Lockyer <gary@catalyst.net.nz>
Tue, 27 Feb 2018 22:47:58 +0000 (11:47 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 3 Mar 2018 04:20:35 +0000 (05:20 +0100)
In the truncation case a duplicate is perfectly expected.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/ldb_tdb/ldb_index.c

index 9c595f243388f765b617b9707754ac919c8cd273..343d95a7c9f12a90ef3cc4a485c56c0a2a29ff3e 100644 (file)
@@ -2191,7 +2191,7 @@ static int ltdb_index_add1(struct ldb_module *module,
                 * forcing in the value with
                 * LDB_FLAG_INTERNAL_DISABLE_SINGLE_VALUE_CHECK
                 */
-               if (exact != NULL) {
+               if (exact != NULL && truncation == KEY_NOT_TRUNCATED) {
                        /* This can't fail, gives a default at worst */
                        const struct ldb_schema_attribute *attr
                                = ldb_schema_attribute_by_name(