summaryrefslogtreecommitdiff
path: root/source4/dsdb/common
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-01-12 09:59:26 +0100
committerStefan Metzmacher <metze@samba.org>2010-01-13 14:52:00 +0100
commit232197e9ab20b68a848fd798c1e8be22a72c6bb5 (patch)
treeb1bc482d6bb3d19ce40516cab97d8fcbc33e77f8 /source4/dsdb/common
parentca9bc96b96425b7cb13797acf57704502bac1514 (diff)
downloadsamba-232197e9ab20b68a848fd798c1e8be22a72c6bb5.tar.gz
samba-232197e9ab20b68a848fd798c1e8be22a72c6bb5.tar.bz2
samba-232197e9ab20b68a848fd798c1e8be22a72c6bb5.zip
s4:dsdb/common: fix major bug in lsa_BinaryString to ldb_val conversation.
In lsa_BinaryString length and size are byte counts! TODO: we may need to do byte order conversion in this functions too... metze
Diffstat (limited to 'source4/dsdb/common')
-rw-r--r--source4/dsdb/common/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 7d3f460c90..652f1345d5 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -686,7 +686,7 @@ struct lsa_BinaryString samdb_result_parameters(TALLOC_CTX *mem_ctx,
if (!s.array) {
return s;
}
- s.length = s.size = val->length/2;
+ s.length = s.size = val->length;
memcpy(s.array, val->data, val->length);
return s;
@@ -935,7 +935,7 @@ int samdb_msg_add_parameters(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, s
const char *attr_name, struct lsa_BinaryString *parameters)
{
struct ldb_val val;
- val.length = parameters->length * 2;
+ val.length = parameters->length;
val.data = (uint8_t *)parameters->array;
return ldb_msg_add_value(msg, attr_name, &val, NULL);
}