[PATCH v2 16/16] pptp: Suggest already saved username

Jukka Rissanen jukka.rissanen at linux.intel.com
Tue Nov 27 02:51:48 PST 2012


If we know the username, send it to agent as a hint what username
was used earlier.
---
 vpn/plugins/pptp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/vpn/plugins/pptp.c b/vpn/plugins/pptp.c
index ec12e4a..1709178 100644
--- a/vpn/plugins/pptp.c
+++ b/vpn/plugins/pptp.c
@@ -301,13 +301,19 @@ static void request_input_append_host(DBusMessageIter *iter, void *user_data)
 static void request_input_append_user_info(DBusMessageIter *iter,
 							void *user_data)
 {
-	char *str = "string";
+	struct vpn_provider *provider = user_data;
+	const char *str = "string";
 
 	connman_dbus_dict_append_basic(iter, "Type",
 				DBUS_TYPE_STRING, &str);
 	str = "mandatory";
 	connman_dbus_dict_append_basic(iter, "Requirement",
 				DBUS_TYPE_STRING, &str);
+
+	str = vpn_provider_get_string(provider, "PPTP.User");
+	if (str != NULL)
+		connman_dbus_dict_append_basic(iter, "Value",
+					DBUS_TYPE_STRING, &str);
 }
 
 struct request_input_reply {
-- 
1.7.11.4




More information about the connman mailing list