[network-manager-applet] connection-editor: Fix handling of wired 802-1x security setting



commit 2c844acc8f00d9c1d3536b114208170c9cdbe7f2
Author: Mikhail Efremov <sem altlinux org>
Date:   Thu Aug 25 20:46:01 2016 +0300

    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.
    
    https://mail.gnome.org/archives/networkmanager-list/2016-August/msg00109.html
    
    Fixes: c21d56dd22057103c8125a49307b4ff47b5b644d

 src/connection-editor/page-8021x-security.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
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 {


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