[network-manager-applet] applet: migrate some openconnect secrets



commit a8aa5f0572e8cbe0400c407327c2f3ba6a169462
Author: Dan Williams <dcbw redhat com>
Date:   Wed May 18 17:31:19 2011 -0500

    applet: migrate some openconnect secrets
    
    This should ensure that secrets that are transient don't get
    remembered.  There are some other migration options we need to
    do here too, but in another patch.

 src/gconf-helpers/gconf-upgrade.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)
---
diff --git a/src/gconf-helpers/gconf-upgrade.c b/src/gconf-helpers/gconf-upgrade.c
index 86abe35..ac6ed99 100644
--- a/src/gconf-helpers/gconf-upgrade.c
+++ b/src/gconf-helpers/gconf-upgrade.c
@@ -2178,6 +2178,22 @@ migrate_openswan (NMConnection *connection, NMSettingVPN *s_vpn)
 	nm_setting_set_secret_flags (NM_SETTING (s_vpn), NM_OPENSWAN_XAUTH_PASSWORD, flags, NULL);
 }
 
+#define NM_DBUS_SERVICE_OPENCONNECT    "org.freedesktop.NetworkManager.openconnect"
+#define NM_OPENCONNECT_KEY_GATEWAY "gateway"
+#define NM_OPENCONNECT_KEY_COOKIE "cookie"
+#define NM_OPENCONNECT_KEY_GWCERT "gwcert"
+
+static void
+migrate_openconnect (NMConnection *connection, NMSettingVPN *s_vpn)
+{
+	NMSettingSecretFlags flags = NM_SETTING_SECRET_FLAG_NOT_SAVED;
+
+	nm_setting_set_secret_flags (NM_SETTING (s_vpn), NM_OPENCONNECT_KEY_GATEWAY, flags, NULL);
+	nm_setting_set_secret_flags (NM_SETTING (s_vpn), NM_OPENCONNECT_KEY_COOKIE, flags, NULL);
+	nm_setting_set_secret_flags (NM_SETTING (s_vpn), NM_OPENCONNECT_KEY_GWCERT, flags, NULL);
+}
+
+
 #define NM_DBUS_SERVICE_PPTP "org.freedesktop.NetworkManager.pptp"
 #define NM_PPTP_KEY_PASSWORD "password"
 
@@ -2217,6 +2233,9 @@ nm_gconf_migrate_09_secret_flags (GConfClient *client,
 		} else if (g_strcmp0 (service, NM_DBUS_SERVICE_OPENSWAN) == 0) {
 			migrate_openswan (connection, s_vpn);
 			return;
+		} else if (g_strcmp0 (service, NM_DBUS_SERVICE_OPENCONNECT) == 0) {
+			migrate_openconnect (connection, s_vpn);
+			return;
 		}
 
 		/* Other VPNs not handled specially here just go through the



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