mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 05:18:23 +02:00
2008-10-26 Dan Williams <dcbw@redhat.com>
* properties/auth-helpers.c properties/import-export.c properties/nm-openvpn.c - Update for setting accessor changes git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4224 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
parent
6711e583fe
commit
1d8779d8e3
4 changed files with 29 additions and 11 deletions
|
|
@ -1,3 +1,10 @@
|
|||
2008-10-26 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* properties/auth-helpers.c
|
||||
properties/import-export.c
|
||||
properties/nm-openvpn.c
|
||||
- Update for setting accessor changes
|
||||
|
||||
2008-10-17 Dan Williams <dcbw@redhat.com>
|
||||
|
||||
* properties/auth-helpers.c
|
||||
|
|
|
|||
|
|
@ -85,9 +85,9 @@ fill_password (GladeXML *xml,
|
|||
gboolean unused;
|
||||
|
||||
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
|
||||
password = keyring_helpers_lookup_secret (s_con->uuid,
|
||||
priv_key_password ? NM_OPENVPN_KEY_CERTPASS : NM_OPENVPN_KEY_PASSWORD,
|
||||
&unused);
|
||||
password = keyring_helpers_lookup_secret (nm_setting_connection_get_uuid (s_con),
|
||||
priv_key_password ? NM_OPENVPN_KEY_CERTPASS : NM_OPENVPN_KEY_PASSWORD,
|
||||
&unused);
|
||||
}
|
||||
|
||||
if (password) {
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ do_import (const char *path, char **lines, GError **error)
|
|||
gboolean have_client = FALSE, have_remote = FALSE;
|
||||
gboolean have_pass = FALSE, have_sk = FALSE;
|
||||
const char *ctype = NULL;
|
||||
const char *basename;
|
||||
|
||||
connection = nm_connection_new ();
|
||||
s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
|
||||
|
|
@ -170,10 +171,12 @@ do_import (const char *path, char **lines, GError **error)
|
|||
s_vpn = NM_SETTING_VPN (nm_setting_vpn_new ());
|
||||
s_vpn->service_type = g_strdup (NM_DBUS_SERVICE_OPENVPN);
|
||||
|
||||
s_con->id = g_path_get_basename (path);
|
||||
last_dot = strrchr (s_con->id, '.');
|
||||
basename = g_path_get_basename (path);
|
||||
last_dot = strrchr (basename, '.');
|
||||
if (last_dot)
|
||||
*last_dot = '\0';
|
||||
g_object_set (s_con, NM_SETTING_CONNECTION_ID, basename, NULL);
|
||||
g_free (basename);
|
||||
|
||||
for (line = lines; *line; line++) {
|
||||
char *comment, **items, *leftover = NULL;
|
||||
|
|
|
|||
|
|
@ -466,7 +466,7 @@ save_secrets (NMVpnPluginUiWidgetInterface *iface,
|
|||
{
|
||||
OpenvpnPluginUiWidgetPrivate *priv = OPENVPN_PLUGIN_UI_WIDGET_GET_PRIVATE (iface);
|
||||
NMSettingConnection *s_con;
|
||||
const char *auth_type;
|
||||
const char *auth_type, *uuid, *id;
|
||||
gboolean ret = FALSE;
|
||||
|
||||
s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION);
|
||||
|
|
@ -478,9 +478,12 @@ save_secrets (NMVpnPluginUiWidgetInterface *iface,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
id = nm_setting_connection_get_id (s_con);
|
||||
uuid = nm_setting_connection_get_uuid (s_con);
|
||||
|
||||
auth_type = get_auth_type (priv->xml);
|
||||
if (auth_type)
|
||||
ret = auth_widget_save_secrets (priv->xml, auth_type, s_con->uuid, s_con->id);
|
||||
ret = auth_widget_save_secrets (priv->xml, auth_type, uuid, id);
|
||||
|
||||
if (!ret)
|
||||
g_set_error (error, OPENVPN_PLUGIN_UI_ERROR,
|
||||
|
|
@ -649,14 +652,17 @@ static char *
|
|||
get_suggested_name (NMVpnPluginUiInterface *iface, NMConnection *connection)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
const char *id;
|
||||
|
||||
g_return_val_if_fail (connection != NULL, NULL);
|
||||
|
||||
s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
|
||||
g_return_val_if_fail (s_con != NULL, NULL);
|
||||
g_return_val_if_fail (s_con->id != NULL, NULL);
|
||||
|
||||
return g_strdup_printf ("%s (openvpn).conf", s_con->id);
|
||||
id = nm_setting_connection_get_id (s_con);
|
||||
g_return_val_if_fail (id != NULL, NULL);
|
||||
|
||||
return g_strdup_printf ("%s (openvpn).conf", id);
|
||||
}
|
||||
|
||||
static guint32
|
||||
|
|
@ -671,6 +677,7 @@ delete_connection (NMVpnPluginUiInterface *iface,
|
|||
GError **error)
|
||||
{
|
||||
NMSettingConnection *s_con;
|
||||
const char *uuid;
|
||||
|
||||
/* Remove any secrets in the keyring associated with this connection's UUID */
|
||||
s_con = (NMSettingConnection *) nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION);
|
||||
|
|
@ -682,8 +689,9 @@ delete_connection (NMVpnPluginUiInterface *iface,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
keyring_helpers_delete_secret (s_con->uuid, NM_OPENVPN_KEY_PASSWORD);
|
||||
keyring_helpers_delete_secret (s_con->uuid, NM_OPENVPN_KEY_CERTPASS);
|
||||
uuid = nm_setting_connection_get_uuid (s_con);
|
||||
keyring_helpers_delete_secret (uuid, NM_OPENVPN_KEY_PASSWORD);
|
||||
keyring_helpers_delete_secret (uuid, NM_OPENVPN_KEY_CERTPASS);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue