2 * Copyright © 2010 Codethink Limited
3 * Copyright © 2010 Novell, Inc.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18 * Authors: Vincent Untz <vuntz@gnome.org>
19 * Ryan Lortie <desrt@desrt.ca>
31 #include "gfileinfo.h"
32 #include "gfileenumerator.h"
33 #include "gfilemonitor.h"
34 #include "gsimplepermission.h"
35 #include "gsettingsbackendinternal.h"
36 #include "gstrfuncsprivate.h"
37 #include "giomodule-priv.h"
38 #include "gportalsupport.h"
41 #define G_TYPE_KEYFILE_SETTINGS_BACKEND (g_keyfile_settings_backend_get_type ())
42 #define G_KEYFILE_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \
43 G_TYPE_KEYFILE_SETTINGS_BACKEND, \
44 GKeyfileSettingsBackend))
45 #define G_IS_KEYFILE_SETTINGS_BACKEND(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \
46 G_TYPE_KEYFILE_SETTINGS_BACKEND))
49 typedef GSettingsBackendClass GKeyfileSettingsBackendClass;
56 } GKeyfileSettingsBackendProperty;
60 GSettingsBackend parent_instance;
63 GPermission *permission;
66 GKeyFile *system_keyfile;
67 GHashTable *system_locks; /* Used as a set, owning the strings it contains */
75 GFileMonitor *file_monitor;
78 GFileMonitor *dir_monitor;
79 } GKeyfileSettingsBackend;
82 #define EXTENSION_PRIORITY 10
84 #define EXTENSION_PRIORITY (glib_should_use_portal () && !glib_has_dconf_access_in_sandbox () ? 110 : 10)
87 G_DEFINE_TYPE_WITH_CODE (GKeyfileSettingsBackend,
88 g_keyfile_settings_backend,
89 G_TYPE_SETTINGS_BACKEND,
90 _g_io_modules_ensure_extension_points_registered ();
91 g_io_extension_point_implement (G_SETTINGS_BACKEND_EXTENSION_POINT_NAME,
92 g_define_type_id, "keyfile", EXTENSION_PRIORITY))
95 compute_checksum (guint8 *digest,
96 gconstpointer contents,
102 checksum = g_checksum_new (G_CHECKSUM_SHA256);
103 g_checksum_update (checksum, contents, length);
104 g_checksum_get_digest (checksum, digest, &len);
105 g_checksum_free (checksum);
106 g_assert (len == 32);
110 g_keyfile_settings_backend_keyfile_write (GKeyfileSettingsBackend *kfsb)
115 contents = g_key_file_to_data (kfsb->keyfile, &length, NULL);
116 g_file_replace_contents (kfsb->file, contents, length, NULL, FALSE,
117 G_FILE_CREATE_REPLACE_DESTINATION |
118 G_FILE_CREATE_PRIVATE,
121 compute_checksum (kfsb->digest, contents, length);
126 group_name_matches (const gchar *group_name,
129 /* sort of like g_str_has_prefix() except that it must be an exact
130 * match or the prefix followed by '/'.
132 * for example 'a' is a prefix of 'a' and 'a/b' but not 'ab'.
136 for (i = 0; prefix[i]; i++)
137 if (prefix[i] != group_name[i])
140 return group_name[i] == '\0' || group_name[i] == '/';
144 convert_path (GKeyfileSettingsBackend *kfsb,
149 gsize key_len = strlen (key);
150 const gchar *last_slash;
152 if (key_len < kfsb->prefix_len ||
153 memcmp (key, kfsb->prefix, kfsb->prefix_len) != 0)
156 key_len -= kfsb->prefix_len;
157 key += kfsb->prefix_len;
159 last_slash = strrchr (key, '/');
161 /* Disallow empty group names or key names */
163 (last_slash != NULL &&
164 (*(last_slash + 1) == '\0' ||
168 if (kfsb->root_group)
170 /* if a root_group was specified, make sure the user hasn't given
171 * a path that ghosts that group name
173 if (last_slash != NULL && (last_slash - key) == kfsb->root_group_len && memcmp (key, kfsb->root_group, last_slash - key) == 0)
178 /* if no root_group was given, ensure that the user gave a path */
179 if (last_slash == NULL)
185 if (last_slash != NULL)
187 *group = g_memdup2 (key, (last_slash - key) + 1);
188 (*group)[(last_slash - key)] = '\0';
191 *group = g_strdup (kfsb->root_group);
196 if (last_slash != NULL)
197 *basename = g_memdup2 (last_slash + 1, key_len - (last_slash - key));
199 *basename = g_strdup (key);
206 path_is_valid (GKeyfileSettingsBackend *kfsb,
209 return convert_path (kfsb, path, NULL, NULL);
213 get_from_keyfile (GKeyfileSettingsBackend *kfsb,
214 const GVariantType *type,
217 GVariant *return_value = NULL;
220 if (convert_path (kfsb, key, &group, &name))
227 sysstr = g_key_file_get_value (kfsb->system_keyfile, group, name, NULL);
228 str = g_key_file_get_value (kfsb->keyfile, group, name, NULL);
230 (g_hash_table_contains (kfsb->system_locks, key) ||
234 str = g_steal_pointer (&sysstr);
239 return_value = g_variant_parse (type, str, NULL, NULL, NULL);
241 /* As a special case, support values of type %G_VARIANT_TYPE_STRING
242 * not being quoted, since users keep forgetting to do it and then
243 * getting confused. */
244 if (return_value == NULL &&
245 g_variant_type_equal (type, G_VARIANT_TYPE_STRING) &&
248 GString *s = g_string_sized_new (strlen (str) + 2);
251 g_string_append_c (s, '\"');
255 g_string_append_c (s, '\\');
256 g_string_append_c (s, *p);
259 g_string_append_c (s, '\"');
260 return_value = g_variant_parse (type, s->str, NULL, NULL, NULL);
261 g_string_free (s, TRUE);
276 set_to_keyfile (GKeyfileSettingsBackend *kfsb,
282 if (g_hash_table_contains (kfsb->system_locks, key))
285 if (convert_path (kfsb, key, &group, &name))
289 gchar *str = g_variant_print (value, FALSE);
290 g_key_file_set_value (kfsb->keyfile, group, name, str);
291 g_variant_unref (g_variant_ref_sink (value));
301 groups = g_key_file_get_groups (kfsb->keyfile, NULL);
303 for (i = 0; groups[i]; i++)
304 if (group_name_matches (groups[i], group))
305 g_key_file_remove_group (kfsb->keyfile, groups[i], NULL);
310 g_key_file_remove_key (kfsb->keyfile, group, name, NULL);
323 g_keyfile_settings_backend_read (GSettingsBackend *backend,
325 const GVariantType *expected_type,
326 gboolean default_value)
328 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
333 return get_from_keyfile (kfsb, expected_type, key);
338 GKeyfileSettingsBackend *kfsb;
343 g_keyfile_settings_backend_write_one (gpointer key,
347 WriteManyData *data = user_data;
348 gboolean success G_GNUC_UNUSED /* when compiling with G_DISABLE_ASSERT */;
350 success = set_to_keyfile (data->kfsb, key, value);
357 g_keyfile_settings_backend_check_one (gpointer key,
361 WriteManyData *data = user_data;
363 return data->failed = g_hash_table_contains (data->kfsb->system_locks, key) ||
364 !path_is_valid (data->kfsb, key);
368 g_keyfile_settings_backend_write_tree (GSettingsBackend *backend,
372 WriteManyData data = { G_KEYFILE_SETTINGS_BACKEND (backend) };
374 if (!data.kfsb->writable)
377 g_tree_foreach (tree, g_keyfile_settings_backend_check_one, &data);
382 g_tree_foreach (tree, g_keyfile_settings_backend_write_one, &data);
383 g_keyfile_settings_backend_keyfile_write (data.kfsb);
385 g_settings_backend_changed_tree (backend, tree, origin_tag);
391 g_keyfile_settings_backend_write (GSettingsBackend *backend,
396 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
402 success = set_to_keyfile (kfsb, key, value);
406 g_settings_backend_changed (backend, key, origin_tag);
407 g_keyfile_settings_backend_keyfile_write (kfsb);
414 g_keyfile_settings_backend_reset (GSettingsBackend *backend,
418 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
420 if (set_to_keyfile (kfsb, key, NULL))
421 g_keyfile_settings_backend_keyfile_write (kfsb);
423 g_settings_backend_changed (backend, key, origin_tag);
427 g_keyfile_settings_backend_get_writable (GSettingsBackend *backend,
430 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
432 return kfsb->writable &&
433 !g_hash_table_contains (kfsb->system_locks, name) &&
434 path_is_valid (kfsb, name);
438 g_keyfile_settings_backend_get_permission (GSettingsBackend *backend,
441 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (backend);
443 return g_object_ref (kfsb->permission);
447 keyfile_to_tree (GKeyfileSettingsBackend *kfsb,
455 groups = g_key_file_get_groups (keyfile, NULL);
456 for (i = 0; groups[i]; i++)
458 gboolean is_root_group;
462 is_root_group = g_strcmp0 (kfsb->root_group, groups[i]) == 0;
464 /* reject group names that will form invalid key names */
465 if (!is_root_group &&
466 (g_str_has_prefix (groups[i], "/") ||
467 g_str_has_suffix (groups[i], "/") || strstr (groups[i], "//")))
470 keys = g_key_file_get_keys (keyfile, groups[i], NULL, NULL);
471 g_assert (keys != NULL);
473 for (j = 0; keys[j]; j++)
477 /* reject key names with slashes in them */
478 if (strchr (keys[j], '/'))
482 path = g_strdup_printf ("%s%s", kfsb->prefix, keys[j]);
484 path = g_strdup_printf ("%s%s/%s", kfsb->prefix, groups[i], keys[j]);
486 value = g_key_file_get_value (keyfile, groups[i], keys[j], NULL);
488 if (dup_check && g_strcmp0 (g_tree_lookup (tree, path), value) == 0)
490 g_tree_remove (tree, path);
495 g_tree_insert (tree, path, value);
504 g_keyfile_settings_backend_keyfile_reload (GKeyfileSettingsBackend *kfsb)
513 g_file_load_contents (kfsb->file, NULL, &contents, &length, NULL, NULL);
514 compute_checksum (digest, contents, length);
516 if (memcmp (kfsb->digest, digest, sizeof digest) != 0)
518 GKeyFile *keyfiles[2];
521 tree = g_tree_new_full ((GCompareDataFunc) strcmp, NULL,
524 keyfiles[0] = kfsb->keyfile;
525 keyfiles[1] = g_key_file_new ();
528 g_key_file_load_from_data (keyfiles[1], contents, length,
529 G_KEY_FILE_KEEP_COMMENTS |
530 G_KEY_FILE_KEEP_TRANSLATIONS, NULL);
532 keyfile_to_tree (kfsb, tree, keyfiles[0], FALSE);
533 keyfile_to_tree (kfsb, tree, keyfiles[1], TRUE);
534 g_key_file_free (keyfiles[0]);
535 kfsb->keyfile = keyfiles[1];
537 if (g_tree_nnodes (tree) > 0)
538 g_settings_backend_changed_tree (&kfsb->parent_instance, tree, NULL);
542 memcpy (kfsb->digest, digest, sizeof digest);
549 g_keyfile_settings_backend_keyfile_writable (GKeyfileSettingsBackend *kfsb)
554 fileinfo = g_file_query_info (kfsb->dir, "access::*", 0, NULL, NULL);
559 g_file_info_get_attribute_boolean (fileinfo, G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE) &&
560 g_file_info_get_attribute_boolean (fileinfo, G_FILE_ATTRIBUTE_ACCESS_CAN_EXECUTE);
561 g_object_unref (fileinfo);
566 if (writable != kfsb->writable)
568 kfsb->writable = writable;
569 g_settings_backend_path_writable_changed (&kfsb->parent_instance, "/");
574 g_keyfile_settings_backend_finalize (GObject *object)
576 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
578 g_key_file_free (kfsb->keyfile);
579 g_object_unref (kfsb->permission);
580 g_key_file_unref (kfsb->system_keyfile);
581 g_hash_table_unref (kfsb->system_locks);
582 g_free (kfsb->defaults_dir);
584 g_file_monitor_cancel (kfsb->file_monitor);
585 g_object_unref (kfsb->file_monitor);
586 g_object_unref (kfsb->file);
588 g_file_monitor_cancel (kfsb->dir_monitor);
589 g_object_unref (kfsb->dir_monitor);
590 g_object_unref (kfsb->dir);
592 g_free (kfsb->root_group);
593 g_free (kfsb->prefix);
595 G_OBJECT_CLASS (g_keyfile_settings_backend_parent_class)
600 g_keyfile_settings_backend_init (GKeyfileSettingsBackend *kfsb)
605 file_changed (GFileMonitor *monitor,
608 GFileMonitorEvent event_type,
611 GKeyfileSettingsBackend *kfsb = user_data;
613 /* Ignore file deletions, let the GKeyFile content remain in tact. */
614 if (event_type != G_FILE_MONITOR_EVENT_DELETED)
615 g_keyfile_settings_backend_keyfile_reload (kfsb);
619 dir_changed (GFileMonitor *monitor,
622 GFileMonitorEvent event_type,
625 GKeyfileSettingsBackend *kfsb = user_data;
627 g_keyfile_settings_backend_keyfile_writable (kfsb);
631 load_system_settings (GKeyfileSettingsBackend *kfsb)
633 GError *error = NULL;
634 const char *dir = "/etc/glib-2.0/settings";
638 kfsb->system_keyfile = g_key_file_new ();
639 kfsb->system_locks = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
641 if (kfsb->defaults_dir)
642 dir = kfsb->defaults_dir;
644 path = g_build_filename (dir, "defaults", NULL);
646 /* The defaults are in the same keyfile format that we use for the settings.
647 * It can be produced from a dconf database using: dconf dump
649 if (!g_key_file_load_from_file (kfsb->system_keyfile, path, G_KEY_FILE_NONE, &error))
651 if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
652 g_warning ("Failed to read %s: %s", path, error->message);
653 g_clear_error (&error);
656 g_debug ("Loading default settings from %s", path);
660 path = g_build_filename (dir, "locks", NULL);
662 /* The locks file is a text file containing a list paths to lock, one per line.
663 * It can be produced from a dconf database using: dconf list-locks
665 if (!g_file_get_contents (path, &contents, NULL, &error))
667 if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT))
668 g_warning ("Failed to read %s: %s", path, error->message);
669 g_clear_error (&error);
676 g_debug ("Loading locks from %s", path);
678 lines = g_strsplit (contents, "\n", 0);
679 for (i = 0; lines[i]; i++)
681 char *line = lines[i];
682 if (line[0] == '#' || line[0] == '\0')
688 g_debug ("Locking key %s", line);
689 g_hash_table_add (kfsb->system_locks, g_steal_pointer (&line));
700 g_keyfile_settings_backend_constructed (GObject *object)
702 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
704 if (kfsb->file == NULL)
706 char *filename = g_build_filename (g_get_user_config_dir (),
707 "glib-2.0", "settings", "keyfile",
709 kfsb->file = g_file_new_for_path (filename);
713 if (kfsb->prefix == NULL)
715 kfsb->prefix = g_strdup ("/");
716 kfsb->prefix_len = 1;
719 kfsb->keyfile = g_key_file_new ();
720 kfsb->permission = g_simple_permission_new (TRUE);
722 kfsb->dir = g_file_get_parent (kfsb->file);
723 g_mkdir_with_parents (g_file_peek_path (kfsb->dir), 0700);
725 kfsb->file_monitor = g_file_monitor (kfsb->file, G_FILE_MONITOR_NONE, NULL, NULL);
726 kfsb->dir_monitor = g_file_monitor (kfsb->dir, G_FILE_MONITOR_NONE, NULL, NULL);
728 compute_checksum (kfsb->digest, NULL, 0);
730 g_signal_connect (kfsb->file_monitor, "changed",
731 G_CALLBACK (file_changed), kfsb);
732 g_signal_connect (kfsb->dir_monitor, "changed",
733 G_CALLBACK (dir_changed), kfsb);
735 g_keyfile_settings_backend_keyfile_writable (kfsb);
736 g_keyfile_settings_backend_keyfile_reload (kfsb);
738 load_system_settings (kfsb);
742 g_keyfile_settings_backend_set_property (GObject *object,
747 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
749 switch ((GKeyfileSettingsBackendProperty)prop_id)
752 /* Construct only. */
753 g_assert (kfsb->file == NULL);
754 if (g_value_get_string (value))
755 kfsb->file = g_file_new_for_path (g_value_get_string (value));
759 /* Construct only. */
760 g_assert (kfsb->prefix == NULL);
761 kfsb->prefix = g_value_dup_string (value);
763 kfsb->prefix_len = strlen (kfsb->prefix);
766 case PROP_ROOT_GROUP:
767 /* Construct only. */
768 g_assert (kfsb->root_group == NULL);
769 kfsb->root_group = g_value_dup_string (value);
770 if (kfsb->root_group)
771 kfsb->root_group_len = strlen (kfsb->root_group);
774 case PROP_DEFAULTS_DIR:
775 /* Construct only. */
776 g_assert (kfsb->defaults_dir == NULL);
777 kfsb->defaults_dir = g_value_dup_string (value);
781 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
787 g_keyfile_settings_backend_get_property (GObject *object,
792 GKeyfileSettingsBackend *kfsb = G_KEYFILE_SETTINGS_BACKEND (object);
794 switch ((GKeyfileSettingsBackendProperty)prop_id)
797 g_value_set_string (value, g_file_peek_path (kfsb->file));
801 g_value_set_string (value, kfsb->prefix);
804 case PROP_ROOT_GROUP:
805 g_value_set_string (value, kfsb->root_group);
808 case PROP_DEFAULTS_DIR:
809 g_value_set_string (value, kfsb->defaults_dir);
813 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
819 g_keyfile_settings_backend_class_init (GKeyfileSettingsBackendClass *class)
821 GObjectClass *object_class = G_OBJECT_CLASS (class);
823 object_class->finalize = g_keyfile_settings_backend_finalize;
824 object_class->constructed = g_keyfile_settings_backend_constructed;
825 object_class->get_property = g_keyfile_settings_backend_get_property;
826 object_class->set_property = g_keyfile_settings_backend_set_property;
828 class->read = g_keyfile_settings_backend_read;
829 class->write = g_keyfile_settings_backend_write;
830 class->write_tree = g_keyfile_settings_backend_write_tree;
831 class->reset = g_keyfile_settings_backend_reset;
832 class->get_writable = g_keyfile_settings_backend_get_writable;
833 class->get_permission = g_keyfile_settings_backend_get_permission;
834 /* No need to implement subscribed/unsubscribe: the only point would be to
835 * stop monitoring the file when there's no GSettings anymore, which is no
840 * GKeyfileSettingsBackend:filename:
842 * The location where the settings are stored on disk.
844 * Defaults to `$XDG_CONFIG_HOME/glib-2.0/settings/keyfile`.
846 g_object_class_install_property (object_class,
848 g_param_spec_string ("filename",
852 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
853 G_PARAM_STATIC_STRINGS));
856 * GKeyfileSettingsBackend:root-path:
858 * All settings read to or written from the backend must fall under the
859 * path given in @root_path (which must start and end with a slash and
860 * not contain two consecutive slashes). @root_path may be "/".
864 g_object_class_install_property (object_class,
866 g_param_spec_string ("root-path",
870 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
871 G_PARAM_STATIC_STRINGS));
874 * GKeyfileSettingsBackend:root-group:
876 * If @root_group is non-%NULL then it specifies the name of the keyfile
877 * group used for keys that are written directly below the root path.
881 g_object_class_install_property (object_class,
883 g_param_spec_string ("root-group",
885 P_("The root group"),
887 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
888 G_PARAM_STATIC_STRINGS));
891 * GKeyfileSettingsBackend:default-dir:
893 * The directory where the system defaults and locks are located.
895 * Defaults to `/etc/glib-2.0/settings`.
897 g_object_class_install_property (object_class,
899 g_param_spec_string ("defaults-dir",
903 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
904 G_PARAM_STATIC_STRINGS));
908 * g_keyfile_settings_backend_new:
909 * @filename: the filename of the keyfile
910 * @root_path: the path under which all settings keys appear
911 * @root_group: (nullable): the group name corresponding to
912 * @root_path, or %NULL
914 * Creates a keyfile-backed #GSettingsBackend.
916 * The filename of the keyfile to use is given by @filename.
918 * All settings read to or written from the backend must fall under the
919 * path given in @root_path (which must start and end with a slash and
920 * not contain two consecutive slashes). @root_path may be "/".
922 * If @root_group is non-%NULL then it specifies the name of the keyfile
923 * group used for keys that are written directly below @root_path. For
924 * example, if @root_path is "/apps/example/" and @root_group is
925 * "toplevel", then settings the key "/apps/example/enabled" to a value
926 * of %TRUE will cause the following to appear in the keyfile:
933 * If @root_group is %NULL then it is not permitted to store keys
934 * directly below the @root_path.
936 * For keys not stored directly below @root_path (ie: in a sub-path),
937 * the name of the subpath (with the final slash stripped) is used as
938 * the name of the keyfile group. To continue the example, if
939 * "/apps/example/profiles/default/font-size" were set to
940 * 12 then the following would appear in the keyfile:
947 * The backend will refuse writes (and return writability as being
948 * %FALSE) for keys outside of @root_path and, in the event that
949 * @root_group is %NULL, also for keys directly under @root_path.
950 * Writes will also be refused if the backend detects that it has the
951 * inability to rewrite the keyfile (ie: the containing directory is not
954 * There is no checking done for your key namespace clashing with the
955 * syntax of the key file format. For example, if you have '[' or ']'
956 * characters in your path names or '=' in your key names you may be in
959 * The backend reads default values from a keyfile called `defaults` in
960 * the directory specified by the #GKeyfileSettingsBackend:defaults-dir property,
961 * and a list of locked keys from a text file with the name `locks` in
964 * Returns: (transfer full): a keyfile-backed #GSettingsBackend
967 g_keyfile_settings_backend_new (const gchar *filename,
968 const gchar *root_path,
969 const gchar *root_group)
971 g_return_val_if_fail (filename != NULL, NULL);
972 g_return_val_if_fail (root_path != NULL, NULL);
973 g_return_val_if_fail (g_str_has_prefix (root_path, "/"), NULL);
974 g_return_val_if_fail (g_str_has_suffix (root_path, "/"), NULL);
975 g_return_val_if_fail (strstr (root_path, "//") == NULL, NULL);
977 return G_SETTINGS_BACKEND (g_object_new (G_TYPE_KEYFILE_SETTINGS_BACKEND,
978 "filename", filename,
979 "root-path", root_path,
980 "root-group", root_group,