network-manager-applet r995 - in trunk: . src/connection-editor src/gconf-helpers
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: network-manager-applet r995 - in trunk: . src/connection-editor src/gconf-helpers
- Date: Fri, 31 Oct 2008 17:48:25 +0000 (UTC)
Author: dcbw
Date: Fri Oct 31 17:48:25 2008
New Revision: 995
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=995&view=rev
Log:
2008-10-31 Dan Williams <dcbw redhat com>
* src/gconf-helpers/gconf-helpers.c
src/gconf-helpers/gconf-helpers.h
- (nm_gconf_copy_private_connection_values): copy private values (like
certificate paths and such) between connections
- (nm_gconf_connection_duplicate): use nm_gconf_copy_private_connection_values()
* src/connection-editor/nm-connection-list.c
- (update_connection): make sure to copy private values when updating
the connection
Modified:
trunk/ChangeLog
trunk/src/connection-editor/nm-connection-list.c
trunk/src/gconf-helpers/gconf-helpers.c
trunk/src/gconf-helpers/gconf-helpers.h
Modified: trunk/src/connection-editor/nm-connection-list.c
==============================================================================
--- trunk/src/connection-editor/nm-connection-list.c (original)
+++ trunk/src/connection-editor/nm-connection-list.c Fri Oct 31 17:48:25 2008
@@ -670,6 +670,10 @@
success = nm_exported_connection_update (original, new_settings, &error);
g_hash_table_destroy (new_settings);
+ /* Hack; make sure that gconf private values are copied */
+ nm_gconf_copy_private_connection_values (nm_exported_connection_get_connection (original),
+ modified);
+
if (!success) {
if (is_permission_denied_error (error))
pending_auth = obtain_auth (error, update_connection_cb, info);
Modified: trunk/src/gconf-helpers/gconf-helpers.c
==============================================================================
--- trunk/src/gconf-helpers/gconf-helpers.c (original)
+++ trunk/src/gconf-helpers/gconf-helpers.c Fri Oct 31 17:48:25 2008
@@ -1794,46 +1794,44 @@
return secrets;
}
+static inline void
+copy_str_item (NMConnection *dst, NMConnection *src, const char *tag)
+{
+ g_object_set_data_full (G_OBJECT (dst), tag, g_strdup (g_object_get_data (G_OBJECT (src), tag)), g_free);
+}
+
+void
+nm_gconf_copy_private_connection_values (NMConnection *dst, NMConnection *src)
+{
+ g_return_if_fail (NM_IS_CONNECTION (dst));
+ g_return_if_fail (NM_IS_CONNECTION (src));
+
+ g_object_set_data (G_OBJECT (dst), NMA_CA_CERT_IGNORE_TAG,
+ g_object_get_data (G_OBJECT (src), NMA_CA_CERT_IGNORE_TAG));
+ g_object_set_data (G_OBJECT (dst), NMA_PHASE2_CA_CERT_IGNORE_TAG,
+ g_object_get_data (G_OBJECT (src), NMA_PHASE2_CA_CERT_IGNORE_TAG));
+
+ copy_str_item (dst, src, NMA_PATH_CLIENT_CERT_TAG);
+ copy_str_item (dst, src, NMA_PATH_PHASE2_CLIENT_CERT_TAG);
+ copy_str_item (dst, src, NMA_PATH_CA_CERT_TAG);
+ copy_str_item (dst, src, NMA_PATH_PHASE2_CA_CERT_TAG);
+ copy_str_item (dst, src, NMA_PATH_PRIVATE_KEY_TAG);
+ copy_str_item (dst, src, NMA_PRIVATE_KEY_PASSWORD_TAG);
+ copy_str_item (dst, src, NMA_PATH_PHASE2_PRIVATE_KEY_TAG);
+ copy_str_item (dst, src, NMA_PHASE2_PRIVATE_KEY_PASSWORD_TAG);
+}
+
NMConnection *
nm_gconf_connection_duplicate (NMConnection *connection)
{
NMConnection *dup;
- GObject *oc;
- GObject *od;
g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
dup = nm_connection_duplicate (connection);
g_return_val_if_fail (NM_IS_CONNECTION (dup), NULL);
- oc = G_OBJECT (connection);
- od = G_OBJECT (dup);
-
- g_object_set_data (od, NMA_CA_CERT_IGNORE_TAG, g_object_get_data (oc, NMA_CA_CERT_IGNORE_TAG));
- g_object_set_data (od, NMA_PHASE2_CA_CERT_IGNORE_TAG, g_object_get_data (oc, NMA_PHASE2_CA_CERT_IGNORE_TAG));
- g_object_set_data_full (od, NMA_PATH_CLIENT_CERT_TAG,
- g_strdup (g_object_get_data (oc, NMA_PATH_CLIENT_CERT_TAG)), g_free);
-
- g_object_set_data_full (od, NMA_PATH_PHASE2_CLIENT_CERT_TAG,
- g_strdup (g_object_get_data (oc, NMA_PATH_PHASE2_CLIENT_CERT_TAG)), g_free);
-
- g_object_set_data_full (od, NMA_PATH_CA_CERT_TAG,
- g_strdup (g_object_get_data (oc, NMA_PATH_CA_CERT_TAG)), g_free);
-
- g_object_set_data_full (od, NMA_PATH_PHASE2_CA_CERT_TAG,
- g_strdup (g_object_get_data (oc, NMA_PATH_PHASE2_CA_CERT_TAG)), g_free);
-
- g_object_set_data_full (od, NMA_PATH_PRIVATE_KEY_TAG,
- g_strdup (g_object_get_data (oc, NMA_PATH_PRIVATE_KEY_TAG)), g_free);
-
- g_object_set_data_full (od, NMA_PRIVATE_KEY_PASSWORD_TAG,
- g_strdup (g_object_get_data (oc, NMA_PRIVATE_KEY_PASSWORD_TAG)), g_free);
-
- g_object_set_data_full (od, NMA_PATH_PHASE2_PRIVATE_KEY_TAG,
- g_strdup (g_object_get_data (oc, NMA_PATH_PHASE2_PRIVATE_KEY_TAG)), g_free);
-
- g_object_set_data_full (od, NMA_PHASE2_PRIVATE_KEY_PASSWORD_TAG,
- g_strdup (g_object_get_data (oc, NMA_PHASE2_PRIVATE_KEY_PASSWORD_TAG)), g_free);
+ nm_gconf_copy_private_connection_values (dup, connection);
return dup;
}
Modified: trunk/src/gconf-helpers/gconf-helpers.h
==============================================================================
--- trunk/src/gconf-helpers/gconf-helpers.h (original)
+++ trunk/src/gconf-helpers/gconf-helpers.h Fri Oct 31 17:48:25 2008
@@ -47,6 +47,8 @@
NMConnection *nm_gconf_connection_duplicate (NMConnection *connection);
+void nm_gconf_copy_private_connection_values (NMConnection *dst, NMConnection *src);
+
#define KEYRING_UUID_TAG "connection-uuid"
#define KEYRING_SN_TAG "setting-name"
#define KEYRING_SK_TAG "setting-key"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]