diff options
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/ldb_tdb/ldb_index.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c index 99288d2b5f..7127c35f43 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_index.c +++ b/source4/lib/ldb/ldb_tdb/ldb_index.c @@ -120,11 +120,12 @@ static struct ldb_dn *ltdb_index_key(struct ldb_context *ldb, h = ldb_attrib_handler(ldb, attr); r = h->canonicalise_fn(ldb, ldb, value, &v); if (r != LDB_SUCCESS) { + const char *errstr = ldb_errstring(ldb); /* canonicalisation can be refused. For example, a attribute that takes wildcards will refuse to canonicalise if the value contains a wildcard */ - ldb_asprintf_errstring(ldb, "Failed to create index key for attribute '%s':%s:%s", - attr, ldb_strerror(r), ldb_errstring(ldb)); + ldb_asprintf_errstring(ldb, "Failed to create index key for attribute '%s':%s%s%s", + attr, ldb_strerror(r), (errstr?":":""), (errstr?errstr:"")); talloc_free(attr_folded); return NULL; } |