diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-12-28 03:31:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:30:18 -0500 |
commit | c8fd1a6f2ea0a4c3ae6535d651077810c4ea611d (patch) | |
tree | 98e199406c4f7181269c75218d84119eaff388ac /source4 | |
parent | d0bc792dba8d4ae1da92abfeca5fb4be5a23b909 (diff) | |
download | samba-c8fd1a6f2ea0a4c3ae6535d651077810c4ea611d.tar.gz samba-c8fd1a6f2ea0a4c3ae6535d651077810c4ea611d.tar.bz2 samba-c8fd1a6f2ea0a4c3ae6535d651077810c4ea611d.zip |
r20373: When adding a base to a "" DN, don't precede it with a comma (,)
Andrew Bartlett
(This used to be commit ef1ca30180b1b225579a8200b65a4853a135602f)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/lib/ldb/common/ldb_dn.c | 12 |
1 files changed, 10 insertions, 2 deletions
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; |