diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2008-09-19 12:39:53 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-10-21 14:40:42 +0200 |
commit | fcc93f68a0d87d3f938bdd6ecd6dc91c6ab648d5 (patch) | |
tree | 9657a9a17d07bcfcac776247435f8322c3043b66 /source4/lib/registry | |
parent | 80af62652b268c9a85fe30ede503924743cfdbde (diff) | |
download | samba-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.c | 8 |
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: |