summaryrefslogtreecommitdiff
path: root/vpn
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-02-13 15:29:01 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-02-19 10:51:43 (GMT)
commit5052b3acb5d041ed9dd00397a36563850faacf00 (patch)
tree3b1f81d5ee25129b23f066bb30c1c7c76c4ea9b4 /vpn
parente12220c94a4fda7c987e24e3368e3f76760f18ec (diff)
downloadconnman-5052b3acb5d041ed9dd00397a36563850faacf00.zip
connman-5052b3acb5d041ed9dd00397a36563850faacf00.tar.gz
connman-5052b3acb5d041ed9dd00397a36563850faacf00.tar.bz2
l2tp: 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/l2tp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vpn/plugins/l2tp.c b/vpn/plugins/l2tp.c
index 2a16ca6..a322178 100644
--- a/vpn/plugins/l2tp.c
+++ b/vpn/plugins/l2tp.c
@@ -642,10 +642,6 @@ static int run_connect(struct vpn_provider *provider,
goto done;
}
- vpn_provider_set_string(provider, "L2TP.User", username);
- vpn_provider_set_string_hide_value(provider, "L2TP.Password",
- password);
-
DBG("username %s password %p", username, password);
l2tp_name = g_strdup_printf("/var/run/connman/connman-xl2tpd.conf");
@@ -714,6 +710,10 @@ static void request_input_cb(struct vpn_provider *provider,
else if (error != NULL)
DBG("error %s", error);
+ vpn_provider_set_string(provider, "L2TP.User", username);
+ vpn_provider_set_string_hide_value(provider, "L2TP.Password",
+ password);
+
run_connect(provider, data->task, data->if_name, data->cb,
data->user_data, username, password);