summaryrefslogtreecommitdiff
path: root/vpn/vpn-provider.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-03-05 16:06:23 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-08 13:09:37 +0200
commit082c0eb57b14e8bddfe4a754ab13ccedb5681157 (patch)
tree7bb55975b29ac3f3eef6ffba3857bfc7c8dc838f /vpn/vpn-provider.c
parent06eb3d46dc8be028d5c484d5e81a2547b748789c (diff)
downloadconnman-082c0eb57b14e8bddfe4a754ab13ccedb5681157.tar.gz
connman-082c0eb57b14e8bddfe4a754ab13ccedb5681157.tar.bz2
connman-082c0eb57b14e8bddfe4a754ab13ccedb5681157.zip
vpn-provider: Do not save or load provisioned VPN connections
The vpnd will not read or save provider data from disk. Only way to provision VPN is by setting necessary data in VPN .config file.
Diffstat (limited to 'vpn/vpn-provider.c')
-rw-r--r--vpn/vpn-provider.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/vpn/vpn-provider.c b/vpn/vpn-provider.c
index 5dd18d63..bb89ccf9 100644
--- a/vpn/vpn-provider.c
+++ b/vpn/vpn-provider.c
@@ -834,7 +834,16 @@ static int vpn_provider_save(struct vpn_provider *provider)
{
GKeyFile *keyfile;
- DBG("provider %p", provider);
+ DBG("provider %p immutable %s", provider,
+ provider->immutable ? "yes" : "no");
+
+ if (provider->immutable == TRUE) {
+ /*
+ * Do not save providers that are provisioned via .config
+ * file.
+ */
+ return -EPERM;
+ }
keyfile = g_key_file_new();
if (keyfile == NULL)
@@ -2004,8 +2013,7 @@ int __vpn_provider_create_from_config(GHashTable *settings,
provider->config_file = g_strdup(config_ident);
provider->config_entry = g_strdup(config_entry);
- if (provider_register(provider) == 0)
- vpn_provider_load(provider);
+ provider_register(provider);
provider_resolv_host_addr(provider);
}
@@ -2021,6 +2029,8 @@ int __vpn_provider_create_from_config(GHashTable *settings,
while (g_hash_table_iter_next(&hash, &key, &value) == TRUE)
__vpn_provider_set_string_immutable(provider, key, value);
+ provider->immutable = TRUE;
+
vpn_provider_save(provider);
err = provider_register(provider);