summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/ejs/mprutil.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c
index 419cb4869e..e921b11475 100644
--- a/source4/scripting/ejs/mprutil.c
+++ b/source4/scripting/ejs/mprutil.c
@@ -184,7 +184,13 @@ static struct MprVar mprLdbMessage(struct ldb_context *ldb, struct ldb_message *
if (attr->ldif_write_fn(ldb, msg, &el->values[0], &v) != 0) {
goto failed;
}
- val = mprData(v.data, v.length);
+ /* FIXME: nasty hack, remove me when ejs will support
+ * arbitrary string and does not truncate on \0 */
+ if (strlen((char *)v.data) != v.length) {
+ val = mprDataBlob(v);
+ } else {
+ val = mprData(v.data, v.length);
+ }
} else {
int j;
val = mprArray(el->name);
@@ -193,7 +199,13 @@ static struct MprVar mprLdbMessage(struct ldb_context *ldb, struct ldb_message *
&el->values[j], &v) != 0) {
goto failed;
}
- mprAddArray(&val, j, mprData(v.data, v.length));
+ /* FIXME: nasty hack, remove me when ejs will support
+ * arbitrary string and does not truncate on \0 */
+ if (strlen((char *)v.data) != v.length) {
+ mprAddArray(&val, j, mprDataBlob(v));
+ } else {
+ mprAddArray(&val, j, mprData(v.data, v.length));
+ }
}
}
mprSetVar(&var, el->name, val);