diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-05-23 12:01:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:53:53 -0500 |
commit | f371d2454298b0e64978c04056da5635d7e72921 (patch) | |
tree | 5bbe9b4bd4235992ced31c093aa358b89854f649 /source4/lib/registry/common/reg_interface.c | |
parent | f7a7192eff21fb48e4bd41ce65d0c0c175d4a1fb (diff) | |
download | samba-f371d2454298b0e64978c04056da5635d7e72921.tar.gz samba-f371d2454298b0e64978c04056da5635d7e72921.tar.bz2 samba-f371d2454298b0e64978c04056da5635d7e72921.zip |
r828: Some fixes in the core and regshell concerning hives and
unicode
(This used to be commit 25c27b176c9905f3968e955f33a6db41b0102a38)
Diffstat (limited to 'source4/lib/registry/common/reg_interface.c')
-rw-r--r-- | source4/lib/registry/common/reg_interface.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c index 3e5a545f9a..e748c836cf 100644 --- a/source4/lib/registry/common/reg_interface.c +++ b/source4/lib/registry/common/reg_interface.c @@ -176,15 +176,15 @@ WERROR reg_open_key(REG_KEY *parent, const char *name, REG_KEY **result) return WERR_OK; } - mem_ctx = talloc_init("mem_ctx"); - - fullname = talloc_asprintf(mem_ctx, "%s%s%s", parent->path, parent->path[strlen(parent->path)-1] == '\\'?"":"\\", name); - if(!parent->handle->functions->open_key) { DEBUG(0, ("Registry backend doesn't have get_subkey_by_name nor open_key!\n")); return WERR_NOT_SUPPORTED; } + mem_ctx = talloc_init("mem_ctx"); + + fullname = talloc_asprintf(mem_ctx, "%s%s%s", reg_key_get_path(parent), strlen(reg_key_get_path(parent))?"\\":"", name); + error = parent->handle->functions->open_key(parent->handle, parent->hive, fullname, result); if(!W_ERROR_IS_OK(error)) { @@ -193,7 +193,7 @@ WERROR reg_open_key(REG_KEY *parent, const char *name, REG_KEY **result) } (*result)->handle = parent->handle; - (*result)->path = fullname; + (*result)->path = talloc_asprintf((*result)->mem_ctx, "%s\\%s", reg_key_get_path_abs(parent), (*result)->name); (*result)->hive = parent->hive; talloc_steal(mem_ctx, (*result)->mem_ctx, fullname); @@ -303,7 +303,7 @@ WERROR reg_key_get_subkey_by_index(REG_KEY *key, int idx, REG_KEY **subkey) return WERR_NOT_SUPPORTED; } - (*subkey)->path = talloc_asprintf((*subkey)->mem_ctx, "%s%s%s", key->path, key->path[strlen(key->path)-1] == '\\'?"":"\\", (*subkey)->name); + (*subkey)->path = talloc_asprintf((*subkey)->mem_ctx, "%s\\%s", reg_key_get_path_abs(key), (*subkey)->name); (*subkey)->handle = key->handle; (*subkey)->hive = key->hive; @@ -334,7 +334,7 @@ WERROR reg_key_get_subkey_by_name(REG_KEY *key, const char *name, REG_KEY **subk if(!W_ERROR_IS_OK(error)) return error; - (*subkey)->path = talloc_asprintf((*subkey)->mem_ctx, "%s%s%s", key->path, key->path[strlen(key->path)-1] == '\\'?"":"\\", (*subkey)->name); + (*subkey)->path = talloc_asprintf((*subkey)->mem_ctx, "%s\\%s", reg_key_get_path_abs(key), (*subkey)->name); (*subkey)->handle = key->handle; (*subkey)->hive = key->hive; |