summaryrefslogtreecommitdiff
path: root/source4/lib/ldb/ldb_tdb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-25 13:13:41 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-25 13:15:18 +1100
commitb55a5adab99f535bb392662d54afbabed116a3b6 (patch)
tree78e333913531104443638693e3b941c69cf76513 /source4/lib/ldb/ldb_tdb
parent2eca02a4080b68fbb2dacb659b1733224cfa462e (diff)
downloadsamba-b55a5adab99f535bb392662d54afbabed116a3b6.tar.gz
samba-b55a5adab99f535bb392662d54afbabed116a3b6.tar.bz2
samba-b55a5adab99f535bb392662d54afbabed116a3b6.zip
s4-ldb: ensure DNs pass validity tests in indexing
Diffstat (limited to 'source4/lib/ldb/ldb_tdb')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 5002de527b..252154ffd9 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -401,6 +401,10 @@ static struct ldb_dn *ltdb_index_key(struct ldb_context *ldb,
if (ldb_should_b64_encode(ldb, &v)) {
char *vstr = ldb_base64_encode(ldb, (char *)v.data, v.length);
if (!vstr) return NULL;
+ /* remove trailing '=' to make it a valid DN */
+ if (vstr[strlen(vstr)-1] == '=') {
+ vstr[strlen(vstr)-1] = 0;
+ }
ret = ldb_dn_new_fmt(ldb, ldb, "%s:%s::%s", LTDB_INDEX, attr_folded, vstr);
talloc_free(vstr);
} else {