From a46beefeb798f63a92f73b2658fd03fa96b55fcb Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 21 Aug 2006 03:52:43 +0000 Subject: r17648: update minschema.js this version returns also oMSyntax and oMObjectClass and also use the right value for the objects CNs add a nasty hack to ejs' mprLdbMessage() to handle binary blobs situations (This used to be commit 8dd1c1c05bc592d76d6e34b303048faf05c0fa6e) --- source4/scripting/ejs/mprutil.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'source4/scripting') 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); -- cgit