diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2004-04-12 20:07:50 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:15 -0500 |
commit | 198a92cb77ef2070957f18da0a8b6a48d01dbe9b (patch) | |
tree | a8154008035dffdae289cb538431dc593a0be4d7 /source4/lib/registry/common | |
parent | b560bf536154a3bcfbfb8bb2ca5e2f154a6d6dd4 (diff) | |
download | samba-198a92cb77ef2070957f18da0a8b6a48d01dbe9b.tar.gz samba-198a92cb77ef2070957f18da0a8b6a48d01dbe9b.tar.bz2 samba-198a92cb77ef2070957f18da0a8b6a48d01dbe9b.zip |
r187: RPC registry backend fixes
(This used to be commit f832d6776cb10f5c7d7ed83e6f66e4d28a461916)
Diffstat (limited to 'source4/lib/registry/common')
-rw-r--r-- | source4/lib/registry/common/reg_interface.c | 11 | ||||
-rw-r--r-- | source4/lib/registry/common/reg_objects.c | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/source4/lib/registry/common/reg_interface.c b/source4/lib/registry/common/reg_interface.c index 5753de1bca..fdbb7345d2 100644 --- a/source4/lib/registry/common/reg_interface.c +++ b/source4/lib/registry/common/reg_interface.c @@ -187,7 +187,12 @@ WERROR reg_key_get_value_by_index(REG_KEY *key, int idx, REG_VAL **val) { if(!key) return WERR_INVALID_PARAM; - if(!key->handle->functions->get_value_by_index) { + if(key->handle->functions->get_value_by_index) { + WERROR status = key->handle->functions->get_value_by_index(key, idx, val); + if(!W_ERROR_IS_OK(status)) + return status; + + } else if(key->handle->functions->fetch_values) { if(!key->cache_values) key->handle->functions->fetch_values(key, &key->cache_values_count, &key->cache_values); @@ -197,9 +202,7 @@ WERROR reg_key_get_value_by_index(REG_KEY *key, int idx, REG_VAL **val) return WERR_NO_MORE_ITEMS; } } else { - WERROR status = key->handle->functions->get_value_by_index(key, idx, val); - if(!W_ERROR_IS_OK(status)) - return status; + return WERR_NOT_SUPPORTED; } (*val)->parent = key; diff --git a/source4/lib/registry/common/reg_objects.c b/source4/lib/registry/common/reg_objects.c index 3f721c107e..787ec52127 100644 --- a/source4/lib/registry/common/reg_objects.c +++ b/source4/lib/registry/common/reg_objects.c @@ -163,11 +163,14 @@ REG_KEY *reg_key_new_abs(const char *path, REG_HANDLE *h, void *data) REG_KEY *reg_key_new_rel(const char *name, REG_KEY *k, void *data) { REG_KEY *r; + const char *parent_path = k?reg_key_get_path(k):""; TALLOC_CTX *mem_ctx = talloc_init(name); r = talloc(mem_ctx, sizeof(REG_KEY)); ZERO_STRUCTP(r); r->handle = k->handle; r->name = talloc_strdup(mem_ctx, name); + + r->path = talloc_asprintf(mem_ctx, "%s%s%s", parent_path, *parent_path && parent_path[strlen(parent_path)-1] != '\\'?"\\":"", name); r->backend_data = data; r->mem_ctx = mem_ctx; r->ref = 1; |