summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2008-09-19 12:39:53 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-10-21 14:40:42 +0200
commitfcc93f68a0d87d3f938bdd6ecd6dc91c6ab648d5 (patch)
tree9657a9a17d07bcfcac776247435f8322c3043b66 /source4/lib/registry
parent80af62652b268c9a85fe30ede503924743cfdbde (diff)
downloadsamba-fcc93f68a0d87d3f938bdd6ecd6dc91c6ab648d5.tar.gz
samba-fcc93f68a0d87d3f938bdd6ecd6dc91c6ab648d5.tar.bz2
samba-fcc93f68a0d87d3f938bdd6ecd6dc91c6ab648d5.zip
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.
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/ldb.c8
1 files changed, 5 insertions, 3 deletions
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: