diff options
author | Samuel Ortiz <sameo@linux.intel.com> | 2011-04-11 12:01:00 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-04-11 12:02:46 +0200 |
commit | 57a27caa37897d4bccb5b750ecfbc2c52857e361 (patch) | |
tree | 7697fdcb9d21325b80cd4d53978c78718bcf973e /src/config.c | |
parent | efe329e83106302ae43ac34a80c98ca524970f20 (diff) | |
download | connman-57a27caa37897d4bccb5b750ecfbc2c52857e361.tar.gz connman-57a27caa37897d4bccb5b750ecfbc2c52857e361.tar.bz2 connman-57a27caa37897d4bccb5b750ecfbc2c52857e361.zip |
config: Default config protection set to TRUE
Configs will be protected, unless explicitely set otherwise.
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 9 |
1 files changed, 7 insertions, 2 deletions
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) { |