diff options
author | Niraj Kumar Goit <niraj.g@samsung.com> | 2022-02-15 10:23:07 +0530 |
---|---|---|
committer | Niraj Kumar Goit <niraj.g@samsung.com> | 2022-02-15 10:25:05 +0530 |
commit | f89b473dfd8e916314b534b3397442f8c869c783 (patch) | |
tree | b6f15a191886ac5b78e98b1b2b210adefae69cf2 /vpn/vpn-config.c | |
parent | dd3cccc5e67548dcc2dd6c6254ed6c97859085d5 (diff) | |
download | connman-f89b473dfd8e916314b534b3397442f8c869c783.tar.gz connman-f89b473dfd8e916314b534b3397442f8c869c783.tar.bz2 connman-f89b473dfd8e916314b534b3397442f8c869c783.zip |
Imported Upstream version 1.40upstream/1.40
Change-Id: Id3e405d088ee3fb19fd0ca049e1cb7f812b40fca
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'vpn/vpn-config.c')
-rw-r--r-- | vpn/vpn-config.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/vpn/vpn-config.c b/vpn/vpn-config.c index f56e51ee..8c6b0681 100644 --- a/vpn/vpn-config.c +++ b/vpn/vpn-config.c @@ -229,7 +229,7 @@ static int load_provider(GKeyFile *keyfile, const char *group, host = get_string(config_provider, "Host"); domain = get_string(config_provider, "Domain"); - if (host && domain) { + if (host) { char *id = __vpn_provider_create_identifier(host, domain); struct vpn_provider *provider; @@ -252,7 +252,7 @@ static int load_provider(GKeyFile *keyfile, const char *group, DBG("provider identifier %s", id); } else { - DBG("invalid values host %s domain %s", host, domain); + DBG("invalid configuration: no host specified"); err = -EINVAL; goto err; } @@ -580,3 +580,18 @@ char **__vpn_config_get_string_list(GKeyFile *key_file, return strlist; } + +bool __vpn_config_get_boolean(GKeyFile *key_file, const char *group_name, + const char *key, bool default_value) +{ + GError *error = NULL; + bool val; + + val = g_key_file_get_boolean(key_file, group_name, key, &error); + if (error) { + g_error_free(error); + return default_value; + } + + return val; +} |