git.samba.org
/
ira
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2eca02a
)
s4-ldb: ensure DNs pass validity tests in indexing
author
Andrew Tridgell
<tridge@samba.org>
Sun, 25 Oct 2009 02:13:41 +0000
(13:13 +1100)
committer
Andrew Tridgell
<tridge@samba.org>
Sun, 25 Oct 2009 02:15:18 +0000
(13:15 +1100)
source4/lib/ldb/ldb_tdb/ldb_index.c
patch
|
blob
|
history
diff --git
a/source4/lib/ldb/ldb_tdb/ldb_index.c
b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 5002de527bf35ccc42e85cb0d1a64a7f57f7e0d5..252154ffd921041938393552e43facd5f99ad384 100644
(file)
--- 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 {