From aee9e6c7cdc46640a5dc8e95c1e4c16057d74b29 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 30 Nov 2006 10:16:19 +0000 Subject: r19965: make the output a bit nicer metze (This used to be commit 8655db41c1e776261ac61a975ca1883b7b59c6aa) --- source4/lib/ldb/ldb_tdb/ldb_index.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4/lib') 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; } -- cgit