From a9fa37d6187eb0d0a074fec2ecffe2915b701188 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 10 Dec 2004 22:28:49 +0000 Subject: r4137: Make *_open_key take a registry_key instead of a hive (more efficient in some cases) (This used to be commit ddf7a331c58976f2c0b4a00390118f1acf60e3eb) --- source4/lib/registry/reg_backend_gconf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/lib/registry/reg_backend_gconf.c') diff --git a/source4/lib/registry/reg_backend_gconf.c b/source4/lib/registry/reg_backend_gconf.c index 2fed2417b7..b53d0fedf5 100644 --- a/source4/lib/registry/reg_backend_gconf.c +++ b/source4/lib/registry/reg_backend_gconf.c @@ -42,15 +42,18 @@ static WERROR reg_open_gconf_hive(struct registry_hive *h, struct registry_key * return WERR_OK; } -static WERROR gconf_open_key (TALLOC_CTX *mem_ctx, struct registry_hive *h, const char *name, struct registry_key **key) +static WERROR gconf_open_key (TALLOC_CTX *mem_ctx, struct registry_key *h, const char *name, struct registry_key **key) { struct registry_key *ret; char *fullpath; - fullpath = talloc_asprintf(mem_ctx, "/%s", reg_path_win2unix(talloc_strdup(mem_ctx, name))); + fullpath = talloc_asprintf(mem_ctx, "%s%s%s", + (char *)h->backend_data, + strlen((char *)h->backend_data) == 1?"":"/", + reg_path_win2unix(talloc_strdup(mem_ctx, name))); /* Check if key exists */ - if(!gconf_client_dir_exists((GConfClient *)h->backend_data, fullpath, NULL)) { + if(!gconf_client_dir_exists((GConfClient *)h->hive->backend_data, fullpath, NULL)) { return WERR_DEST_NOT_FOUND; } -- cgit