summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-08-07 14:22:54 +1000
committerAndrew Bartlett <abartlet@samba.org>2009-08-07 14:22:54 +1000
commitdd557cc3613fa791d44cf34d2a1ddaaff93ab3fd (patch)
tree3c7aa60ad8091b40713312f289b70fe3c72b9976 /source4
parent37b8235afe4036f7defd9465ae431cae9804fa18 (diff)
downloadsamba-dd557cc3613fa791d44cf34d2a1ddaaff93ab3fd.tar.gz
samba-dd557cc3613fa791d44cf34d2a1ddaaff93ab3fd.tar.bz2
samba-dd557cc3613fa791d44cf34d2a1ddaaff93ab3fd.zip
s4:ldb Make error message in rnd_name more useful
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/modules/rdn_name.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/lib/ldb/modules/rdn_name.c b/source4/lib/ldb/modules/rdn_name.c
index 65cdb2545e..8b54f52b5e 100644
--- a/source4/lib/ldb/modules/rdn_name.c
+++ b/source4/lib/ldb/modules/rdn_name.c
@@ -156,9 +156,15 @@ static int rdn_name_add(struct ldb_module *module, struct ldb_request *req)
}
}
if (i == attribute->num_values) {
- ldb_debug_set(ldb, LDB_DEBUG_FATAL,
- "RDN mismatch on %s: %s (%s)",
- ldb_dn_get_linearized(msg->dn), rdn_name, rdn_val.data);
+ char *rdn_errstring = talloc_asprintf(ac, "RDN mismatch on %s: %s (%.*s) should match one of:",
+ ldb_dn_get_linearized(msg->dn), rdn_name,
+ (int)rdn_val.length, (const char *)rdn_val.data);
+ for (i = 0; i < attribute->num_values; i++) {
+ rdn_errstring = talloc_asprintf_append(rdn_errstring, " (%.*s)",
+ (int)attribute->values[i].length,
+ (const char *)attribute->values[i].data);
+ }
+ ldb_debug_set(ldb, LDB_DEBUG_FATAL, "%s", rdn_errstring);
talloc_free(ac);
/* Match AD's error here */
return LDB_ERR_INVALID_DN_SYNTAX;