From fcc93f68a0d87d3f938bdd6ecd6dc91c6ab648d5 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Fri, 19 Sep 2008 12:39:53 +0200 Subject: Registry server LDB backend REG_BINARY type: Save it directly in LDB With this patch the REG_BINARY type is saved directly in a LDB registry database rather than converted in a hex-string. --- source4/lib/registry/ldb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4') diff --git a/source4/lib/registry/ldb.c b/source4/lib/registry/ldb.c index 53ec076db3..6c7c448b3d 100644 --- a/source4/lib/registry/ldb.c +++ b/source4/lib/registry/ldb.c @@ -72,7 +72,7 @@ static void reg_ldb_unpack_value(TALLOC_CTX *mem_ctx, case REG_BINARY: if (val != NULL) - *data = strhex_to_data_blob((char *)val->data); + *data = data_blob_talloc(mem_ctx, val->data, val->length); else { data->data = NULL; data->length = 0; @@ -117,8 +117,10 @@ static struct ldb_message *reg_ldb_pack_value(struct ldb_context *ctx, break; case REG_BINARY: - ldb_msg_add_string(msg, "data", - data_blob_hex_string(mem_ctx, &data)); + if (data.length > 0) + ldb_msg_add_value(msg, "data", &data, NULL); + else + ldb_msg_add_empty(msg, "data", LDB_FLAG_MOD_DELETE, NULL); break; case REG_DWORD: -- cgit