summaryrefslogtreecommitdiff
path: root/lib/ldb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2017-06-09 14:15:19 +1200
committerGarming Sam <garming@samba.org>2017-06-15 01:24:25 +0200
commit2277301e46614154977b242d38669673eee5fe25 (patch)
treefb07f489160be112f799f3bd3e19fb373ca9f024 /lib/ldb
parentf6f73f70919e3360197713e378d49e6eecfe2f1c (diff)
downloadsamba-2277301e46614154977b242d38669673eee5fe25.tar.gz
ldb_tdb: Improve logging on unique index violation
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'lib/ldb')
-rw-r--r--lib/ldb/ldb_tdb/ldb_index.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/ldb/ldb_tdb/ldb_index.c b/lib/ldb/ldb_tdb/ldb_index.c
index 76f3cb392e2..232bb4c16d9 100644
--- a/lib/ldb/ldb_tdb/ldb_index.c
+++ b/lib/ldb/ldb_tdb/ldb_index.c
@@ -1179,9 +1179,22 @@ static int ltdb_index_add1(struct ldb_module *module, const char *dn,
if (list->count > 0 &&
a->flags & LDB_ATTR_FLAG_UNIQUE_INDEX) {
- talloc_free(list);
+ /*
+ * We do not want to print info about a possibly
+ * confidential DN that the conflict was with in the
+ * user-visible error string
+ */
+ ldb_debug(ldb, LDB_DEBUG_WARNING,
+ __location__ ": unique index violation on %s in %s, "
+ "conficts with %*.*s in %s",
+ el->name, dn,
+ (int)list->dn[0].length,
+ (int)list->dn[0].length,
+ list->dn[0].data,
+ ldb_dn_get_linearized(dn_key));
ldb_asprintf_errstring(ldb, __location__ ": unique index violation on %s in %s",
el->name, dn);
+ talloc_free(list);
return LDB_ERR_ENTRY_ALREADY_EXISTS;
}