diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-01-09 19:06:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:08:35 -0500 |
commit | 1303f51099c2054c3966c6ba34490c5ffad85c13 (patch) | |
tree | df6db9f7f07aa2429daa1774701a8827ed3d4288 | |
parent | fd9a4436c03fe88350ad639bea01add5db74c287 (diff) | |
download | samba-1303f51099c2054c3966c6ba34490c5ffad85c13.tar.gz samba-1303f51099c2054c3966c6ba34490c5ffad85c13.tar.bz2 samba-1303f51099c2054c3966c6ba34490c5ffad85c13.zip |
r4623: Convert values from UTF8 to UTF16 in gconf registry backend (caught
by Andrew Bartlett)
(This used to be commit da3c7712d234291f9c5a3c48daae02bdf0878bf0)
-rw-r--r-- | source4/lib/registry/reg_backend_gconf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source4/lib/registry/reg_backend_gconf.c b/source4/lib/registry/reg_backend_gconf.c index b53d0fedf5..47d8c760ab 100644 --- a/source4/lib/registry/reg_backend_gconf.c +++ b/source4/lib/registry/reg_backend_gconf.c @@ -72,6 +72,7 @@ static WERROR gconf_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *p, GConfValue *value; struct registry_value *newval; char *fullpath = p->backend_data; + const char *tmp; int i; cur = entries = gconf_client_all_entries((GConfClient*)p->hive->backend_data, fullpath, NULL); @@ -92,8 +93,8 @@ static WERROR gconf_get_value_by_id(TALLOC_CTX *mem_ctx, struct registry_key *p, case GCONF_VALUE_STRING: newval->data_type = REG_SZ; - newval->data_blk = talloc_strdup(mem_ctx, gconf_value_get_string(value)); - newval->data_len = strlen(newval->data_blk); + tmp = gconf_value_get_string(value); + newval->data_len = convert_string_talloc(mem_ctx, CH_UTF8, CH_UTF16, tmp, strlen(tmp), &(newval->data_blk)); break; case GCONF_VALUE_INT: @@ -149,7 +150,7 @@ static WERROR gconf_get_subkey_by_id(TALLOC_CTX *mem_ctx, struct registry_key *p return WERR_OK; } -static WERROR gconf_set_value(struct registry_key *key, const char *valname, int type, void *data, int len) +static WERROR gconf_set_value(struct registry_key *key, const char *valname, uint32 type, void *data, int len) { GError *error = NULL; char *valpath; |