From bc653d222519965e552736b0ab30dc1b40539152 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 8 Oct 2009 23:00:01 -0700 Subject: [PATCH] vpn: clear secrets when the connection fails NM previously only cleared secrets when the VPN service daemon quit, and the service daemons are on a 10-second inactivity timer. So if the user tried to re-activate the failed VPN connection within 10 seconds the old secrets would get used, which clearly isn't what we want. Ensure that whenever the VPN connection fails or disconnects, we ask the settings service for secrets again the next time. --- src/vpn-manager/nm-vpn-connection.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c index a89c7101f7..f8360dc669 100644 --- a/src/vpn-manager/nm-vpn-connection.c +++ b/src/vpn-manager/nm-vpn-connection.c @@ -912,6 +912,12 @@ vpn_cleanup (NMVPNConnection *connection) g_free (priv->tundev); priv->tundev = NULL; } + + /* Clear out connection secrets to ensure that the settings service + * gets asked for them next time the connection is activated. + */ + if (priv->connection) + nm_connection_clear_secrets (priv->connection); } static void