From 526a53bdd414874c9fdae35c3b08d4ae98d512b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 20 Sep 2011 19:46:26 +0200 Subject: [PATCH] shell-network-agent: Do not handle VPN secrets VPN secrets are currently unhandled by the UI code. To avoid lengthy timeouts, bail out early with an error, so NetworkManager falls back to the nm-applet agent directly. https://bugzilla.gnome.org/show_bug.cgi?id=658484 --- src/shell-network-agent.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/shell-network-agent.c b/src/shell-network-agent.c index 8a474accd..86ea103a5 100644 --- a/src/shell-network-agent.c +++ b/src/shell-network-agent.c @@ -324,8 +324,23 @@ shell_network_agent_get_secrets (NMSecretAgent *agent, gpointer callback_data) { ShellNetworkAgent *self = SHELL_NETWORK_AGENT (agent); - ShellAgentRequest *request = g_slice_new (ShellAgentRequest); + ShellAgentRequest *request; + NMSettingConnection *setting_connection; + const char *connection_type; + /* VPN secrets are currently unimplemented - bail out early */ + setting_connection = nm_connection_get_setting_connection (connection); + connection_type = nm_setting_connection_get_connection_type (setting_connection); + if (strcmp (connection_type, "vpn") == 0) + { + GError *error = g_error_new (NM_SECRET_AGENT_ERROR, + NM_SECRET_AGENT_ERROR_AGENT_CANCELED, + "VPN secrets are currently unhandled."); + callback (NM_SECRET_AGENT (self), connection, NULL, error, callback_data); + return; + } + + request = g_slice_new (ShellAgentRequest); request->self = g_object_ref (self); request->connection = g_object_ref (connection); request->setting_name = g_strdup (setting_name);