From 57a27caa37897d4bccb5b750ecfbc2c52857e361 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Mon, 11 Apr 2011 12:01:00 +0200 Subject: config: Default config protection set to TRUE Configs will be protected, unless explicitely set otherwise. --- src/config.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/config.c') diff --git a/src/config.c b/src/config.c index a0872f71..53f9ad0e 100644 --- a/src/config.c +++ b/src/config.c @@ -373,6 +373,7 @@ err: static int load_config(struct connman_config *config) { GKeyFile *keyfile; + GError *error = NULL; gsize length; char **groups; char *str; @@ -401,8 +402,11 @@ static int load_config(struct connman_config *config) } protected = g_key_file_get_boolean(keyfile, "global", - CONFIG_KEY_PROT, NULL); - config->protected = protected; + CONFIG_KEY_PROT, &error); + if (error == NULL) + config->protected = protected; + else + config->protected = TRUE; groups = g_key_file_get_groups(keyfile, &length); @@ -478,6 +482,7 @@ int __connman_config_load_service(GKeyFile *keyfile, const char *group, service_name); g_key_file_set_string(keyfile, "global", CONFIG_KEY_DESC, "Internal Config File"); + g_key_file_set_boolean(keyfile, "global", CONFIG_KEY_PROT, FALSE); content = g_key_file_to_data(keyfile, &content_length, NULL); if (content == NULL) { -- cgit v1.2.3