From c8fd1a6f2ea0a4c3ae6535d651077810c4ea611d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 28 Dec 2006 03:31:18 +0000 Subject: r20373: When adding a base to a "" DN, don't precede it with a comma (,) Andrew Bartlett (This used to be commit ef1ca30180b1b225579a8200b65a4853a135602f) --- source4/lib/ldb/common/ldb_dn.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/lib/ldb/common/ldb_dn.c b/source4/lib/ldb/common/ldb_dn.c index dc440ef3de..0649626d61 100644 --- a/source4/lib/ldb/common/ldb_dn.c +++ b/source4/lib/ldb/common/ldb_dn.c @@ -988,7 +988,11 @@ bool ldb_dn_add_base(struct ldb_dn *dn, struct ldb_dn *base) } if (dn->casefold && s) { - t = talloc_asprintf(dn, "%s,%s", dn->casefold, s); + if (*dn->casefold) { + t = talloc_asprintf(dn, "%s,%s", dn->casefold, s); + } else { + t = talloc_strdup(dn, s); + } LDB_FREE(dn->casefold); dn->casefold = t; } @@ -1001,7 +1005,11 @@ bool ldb_dn_add_base(struct ldb_dn *dn, struct ldb_dn *base) return false; } - t = talloc_asprintf(dn, "%s,%s", dn->linearized, s); + if (*dn->linearized) { + t = talloc_asprintf(dn, "%s,%s", dn->linearized, s); + } else { + t = talloc_strdup(dn, s); + } if ( ! t) { dn->invalid = true; return false; -- cgit