From 25ed82e7ee84a069661c3dd8b0f808049ee7fa88 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 23 May 2004 14:18:08 +0000 Subject: r834: Fix gconf and dir backends (This used to be commit fe5166ee88d401cdd493644af4876e803f546aef) --- .../lib/registry/reg_backend_gconf/reg_backend_gconf.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'source4/lib/registry/reg_backend_gconf') diff --git a/source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c b/source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c index 8f9fd6625b..c705a2e3cb 100644 --- a/source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c +++ b/source4/lib/registry/reg_backend_gconf/reg_backend_gconf.c @@ -41,10 +41,22 @@ static WERROR reg_close_gconf(REG_HANDLE *h) return WERR_OK; } -static WERROR gconf_open_key (REG_HANDLE *h, const char *name, REG_KEY **key) +static WERROR gconf_get_hive (REG_HANDLE *h, int hivenum, REG_KEY **key) +{ + if(hivenum != 0) return WERR_NO_MORE_ITEMS; + *key = reg_key_new_abs("", h, NULL); + (*key)->backend_data = talloc_strdup((*key)->mem_ctx, "/"); + return WERR_OK; +} + +static WERROR gconf_open_key (REG_HANDLE *h, int hivenum, const char *name, REG_KEY **key) { REG_KEY *ret; - char *fullpath = reg_path_win2unix(strdup(name)); + char *fullpath; + + if(hivenum != 0) return WERR_NO_MORE_ITEMS; + + fullpath = reg_path_win2unix(strdup(name)); /* Check if key exists */ if(!gconf_client_dir_exists((GConfClient *)h->backend_data, fullpath, NULL)) { @@ -183,6 +195,7 @@ static struct registry_ops reg_backend_gconf = { .name = "gconf", .open_registry = reg_open_gconf, .close_registry = reg_close_gconf, + .get_hive = gconf_get_hive, .open_key = gconf_open_key, .fetch_subkeys = gconf_fetch_subkeys, .fetch_values = gconf_fetch_values, -- cgit