[PATCH] connection-editor: Fix handling of wired 802-1x security setting



Function nm_setting_duplicate() can't copy object's data.
As a result a value of the "Ignore CA certificate" checkbox was
always lost. So don't copy settings, just use g_object_ref() again
and remove the 8021x setting from the temporary object to prevent
the clearing of secrets.

Fixes: c21d56dd22057103c8125a49307b4ff47b5b644d
---
 src/connection-editor/page-8021x-security.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/connection-editor/page-8021x-security.c b/src/connection-editor/page-8021x-security.c
index 6dad8db..b1904c7 100644
--- a/src/connection-editor/page-8021x-security.c
+++ b/src/connection-editor/page-8021x-security.c
@@ -172,8 +172,12 @@ ce_page_validate_v (CEPage *page, NMConnection *connection, GError **error)
                        ws_802_1x_fill_connection (priv->security, "wpa_eap_auth_combo", tmp_connection);
 
                        s_8021x = nm_connection_get_setting (tmp_connection, NM_TYPE_SETTING_802_1X);
-                       nm_connection_add_setting (connection, nm_setting_duplicate (s_8021x));
+                       nm_connection_add_setting (connection, NM_SETTING (g_object_ref (s_8021x)));
 
+                       /* Remove the 8021x setting to prevent the clearing of secrets when the
+                        * simple-connection is destroyed.
+                        */
+                       nm_connection_remove_setting (tmp_connection, NM_TYPE_SETTING_802_1X);
                        g_object_unref (tmp_connection);
                }
        } else {
-- 
2.7.4



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