summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-02-13 15:29:02 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-19 10:51:44 (GMT)
commita7717e3ea2abc8e702e29230857eed8ed0b99115 (patch)
tree23c7f1f213c7fe719c3b00d0f0669a63ec71777a /vpn
parent5052b3acb5d041ed9dd00397a36563850faacf00 (diff)
downloadconnman-a7717e3ea2abc8e702e29230857eed8ed0b99115.zip
connman-a7717e3ea2abc8e702e29230857eed8ed0b99115.tar.gz
connman-a7717e3ea2abc8e702e29230857eed8ed0b99115.tar.bz2
pptp: Set the username/password before starting daemon
This is required in order to avoid free memory access that is happening if we call vpn_provider_set_string() with same string that is already in the settings db.
Diffstat (limited to 'vpn')
-rw-r--r--vpn/plugins/pptp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vpn/plugins/pptp.c b/vpn/plugins/pptp.c
index c0d7c00..01b5e2b 100644
--- a/vpn/plugins/pptp.c
+++ b/vpn/plugins/pptp.c
@@ -441,10 +441,6 @@ static int run_connect(struct vpn_provider *provider,
goto done;
}
- vpn_provider_set_string(provider, "PPTP.User", username);
- vpn_provider_set_string_hide_value(provider, "PPTP.Password",
- password);
-
DBG("username %s password %p", username, password);
str = g_strdup_printf("%s %s --nolaunchpppd --loglevel 2",
@@ -520,6 +516,10 @@ static void request_input_cb(struct vpn_provider *provider,
else if (error != NULL)
DBG("error %s", error);
+ vpn_provider_set_string(provider, "PPTP.User", username);
+ vpn_provider_set_string_hide_value(provider, "PPTP.Password",
+ password);
+
run_connect(provider, data->task, data->if_name, data->cb,
data->user_data, username, password);