[gnome-control-center/benzea/fix-non-wifi-password-saving: 3/3] network: Fix saving passwords for non-wifi connections




commit ddf55350e56f7a8694a0a114923bc9cc5efb0c84
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Dec 9 17:59:59 2021 +0100

    network: Fix saving passwords for non-wifi connections
    
    When validating security settings for non-wifi connections, we
    temporarily create a wireless connection. Unfortunately, when this
    connection is destroyed, it'll clear the stored password from the 802.1x
    settings object.
    
    Avoid this by removing the setting before the temporary connection is
    destroyed.
    
    Closes: #337

 panels/network/connection-editor/ce-page-8021x-security.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/panels/network/connection-editor/ce-page-8021x-security.c 
b/panels/network/connection-editor/ce-page-8021x-security.c
index 1e4f1464a..ecb561dd4 100644
--- a/panels/network/connection-editor/ce-page-8021x-security.c
+++ b/panels/network/connection-editor/ce-page-8021x-security.c
@@ -141,6 +141,11 @@ ce_page_8021x_security_validate (CEPage *cepage, NMConnection *connection, GErro
 
                        s_8021x = nm_connection_get_setting (tmp_connection, NM_TYPE_SETTING_802_1X);
                        nm_connection_add_setting (connection, NM_SETTING (g_object_ref (s_8021x)));
+
+                       /* The NMSimpleConnection dispose routine clears the secrets otherwise.
+                        * https://gitlab.gnome.org/GNOME/gnome-control-center/-/merge_requests/1099
+                        */
+                       nm_connection_remove_setting (tmp_connection, NM_TYPE_SETTING_802_1X);
                }
        } else {
                nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);


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