diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-12-15 02:27:22 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:27 -0500 |
commit | efdf83f4a676d8c8faa66e3c073c72a0d649bde8 (patch) | |
tree | 032ec8283f02a14bd1dcac01d10b83ec045364e4 /source4/lib | |
parent | d7081b1a082515087dfc37a9d4a6377e3fa8bf29 (diff) | |
download | samba-efdf83f4a676d8c8faa66e3c073c72a0d649bde8.tar.gz samba-efdf83f4a676d8c8faa66e3c073c72a0d649bde8.tar.bz2 samba-efdf83f4a676d8c8faa66e3c073c72a0d649bde8.zip |
r4213: Store REG_SZ in UTF16, not the unix charset..
It is now possible to use the "Add..." button in the Security
tab of the File Properties Dialog box.
(This used to be commit 9fa25260d3f18dd0dd041477c48571b53d86f3c4)
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/registry/common/reg_util.c | 10 | ||||
-rw-r--r-- | source4/lib/registry/reg_backend_nt4.c | 7 |
2 files changed, 4 insertions, 13 deletions
diff --git a/source4/lib/registry/common/reg_util.c b/source4/lib/registry/common/reg_util.c index 68144fc56f..3da875ca0b 100644 --- a/source4/lib/registry/common/reg_util.c +++ b/source4/lib/registry/common/reg_util.c @@ -57,11 +57,10 @@ char *reg_val_data_string(TALLOC_CTX *mem_ctx, struct registry_value *v) if(v->data_len == 0) return talloc_strdup(mem_ctx, ""); switch (v->data_type) { - case REG_SZ: - return talloc_strndup(mem_ctx, v->data_blk, v->data_len); - case REG_EXPAND_SZ: - return talloc_strndup(mem_ctx, v->data_blk, v->data_len); + case REG_SZ: + convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, v->data_blk, v->data_len, (void **)&ret); + return ret; case REG_BINARY: ret = talloc(mem_ctx, v->data_len * 3 + 2); @@ -120,8 +119,7 @@ BOOL reg_string_to_val(TALLOC_CTX *mem_ctx, const char *type_str, const char *da { case REG_SZ: case REG_EXPAND_SZ: - (*value)->data_blk = talloc_strdup(mem_ctx, data_str); - (*value)->data_len = strlen(data_str); + (*value)->data_len = convert_string_talloc(mem_ctx, CH_UNIX, CH_UTF16, data_str, strlen(data_str), &(*value)->data_blk); break; case REG_DWORD: (*value)->data_len = sizeof(uint32); diff --git a/source4/lib/registry/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4.c index 5633156b20..6c48b9bd1b 100644 --- a/source4/lib/registry/reg_backend_nt4.c +++ b/source4/lib/registry/reg_backend_nt4.c @@ -935,13 +935,6 @@ static WERROR vk_to_val(TALLOC_CTX *mem_ctx, struct registry_key *parent, VK_HDR } - if(tmp->data_type == REG_SZ) { - char *ret; - dat_len = convert_string_talloc(mem_ctx, CH_UTF16, CH_UNIX, dtmp, dat_len, (void **)&ret); - dtmp = ret; - } - - tmp->data_blk = dtmp; tmp->data_len = dat_len; } |