diff options
author | Mikhail Efremov <sem@altlinux.org> | 2016-08-25 20:46:01 +0300 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2016-08-26 14:26:49 +0200 |
commit | 277e261338bc7b10c380763678f100c6d584dabe (patch) | |
tree | 624cbac92eca780ecac3c9fd6386fa3d0f0d5e15 | |
parent | f5a4e37d1c1ff0eb881787427942001f3d6e258a (diff) | |
download | network-manager-applet-277e261338bc7b10c380763678f100c6d584dabe.tar.gz |
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
(cherry picked from commit 2c844acc8f00d9c1d3536b114208170c9cdbe7f2)
-rw-r--r-- | 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 6dad8db9..b1904c74 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 { |