|
|
a11c41 |
From 4269c292020aa11d7b8e17e804ad207e892d2bfe Mon Sep 17 00:00:00 2001
|
|
|
a11c41 |
From: Benjamin Berg <bberg@redhat.com>
|
|
|
a11c41 |
Date: Thu, 9 Dec 2021 17:53:09 +0100
|
|
|
a11c41 |
Subject: [PATCH 8/8] network: Fix saving passwords for non-wifi connections
|
|
|
a11c41 |
|
|
|
a11c41 |
When validating security settings for non-wifi connections, we
|
|
|
a11c41 |
temporarily create a wireless connection. Unfortunately, when this
|
|
|
a11c41 |
connection is destroyed, it'll clear the stored password from the 802.1x
|
|
|
a11c41 |
settings object.
|
|
|
a11c41 |
|
|
|
a11c41 |
Avoid this by removing the setting before unref'ing the temporary
|
|
|
a11c41 |
connection.
|
|
|
a11c41 |
---
|
|
|
a11c41 |
.../connection-editor/ce-page-8021x-security.c | 15 +++++----------
|
|
|
a11c41 |
1 file changed, 5 insertions(+), 10 deletions(-)
|
|
|
a11c41 |
|
|
|
a11c41 |
diff --git a/panels/network/connection-editor/ce-page-8021x-security.c b/panels/network/connection-editor/ce-page-8021x-security.c
|
|
|
a11c41 |
index f7d31969a..0ac057f79 100644
|
|
|
a11c41 |
--- a/panels/network/connection-editor/ce-page-8021x-security.c
|
|
|
a11c41 |
+++ b/panels/network/connection-editor/ce-page-8021x-security.c
|
|
|
a11c41 |
@@ -126,22 +126,17 @@ validate (CEPage *cepage, NMConnection *connection, GError **error)
|
|
|
a11c41 |
/* FIXME: get failed property and error out of wireless security objects */
|
|
|
a11c41 |
valid = wireless_security_validate (page->security, error);
|
|
|
a11c41 |
if (valid) {
|
|
|
a11c41 |
- NMSetting *s_con;
|
|
|
a11c41 |
-
|
|
|
a11c41 |
/* Here's a nice hack to work around the fact that ws_802_1x_fill_connection needs wireless setting. */
|
|
|
a11c41 |
- tmp_connection = nm_simple_connection_new ();
|
|
|
a11c41 |
+ tmp_connection = nm_simple_connection_new_clone (connection);
|
|
|
a11c41 |
nm_connection_add_setting (tmp_connection, nm_setting_wireless_new ());
|
|
|
a11c41 |
|
|
|
a11c41 |
- /* temp connection needs a 'connection' setting too, since most of
|
|
|
a11c41 |
- * the EAP methods need the UUID for CA cert ignore stuff.
|
|
|
a11c41 |
- */
|
|
|
a11c41 |
- s_con = nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION);
|
|
|
a11c41 |
- nm_connection_add_setting (tmp_connection, nm_setting_duplicate (s_con));
|
|
|
a11c41 |
-
|
|
|
a11c41 |
ws_802_1x_fill_connection (page->security, "wpa_eap_auth_combo", tmp_connection);
|
|
|
a11c41 |
|
|
|
a11c41 |
+ /* NOTE: It is important we create a copy of the settings, as the
|
|
|
a11c41 |
+ * secrets might be cleared otherwise.
|
|
|
a11c41 |
+ */
|
|
|
a11c41 |
s_8021x = nm_connection_get_setting (tmp_connection, NM_TYPE_SETTING_802_1X);
|
|
|
a11c41 |
- nm_connection_add_setting (connection, NM_SETTING (g_object_ref (s_8021x)));
|
|
|
a11c41 |
+ nm_connection_add_setting (connection, nm_setting_duplicate (NM_SETTING (s_8021x)));
|
|
|
a11c41 |
|
|
|
a11c41 |
g_object_unref (tmp_connection);
|
|
|
a11c41 |
}
|
|
|
a11c41 |
--
|
|
|
a11c41 |
2.34.1
|
|
|
a11c41 |
|