[gnome-shell] shell-network-agent: Do not handle VPN secrets



commit 526a53bdd414874c9fdae35c3b08d4ae98d512b8
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Sep 20 19:46:26 2011 +0200

    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 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-network-agent.c b/src/shell-network-agent.c
index 8a474ac..86ea103 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]