[network-manager-applet: 1/2] applet: If permitted, create system Wi-Fi connections




commit a0f95d83ff946ba854143414c97c4ed7af19b7fa
Author: Andrew Zaborowski <andrew zaborowski intel com>
Date:   Wed Jun 9 22:45:42 2021 +0200

    applet: If permitted, create system Wi-Fi connections
    
    Wi-Fi connections were being always created with the default of
    connection.permissions=user:<current_user>.  Now create them with empty
    permissions ("All users may connect to this network") if the user is
    authorized to create/modify system connections, similar to the logic in
    other clients.

 src/applet-device-wifi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index b39d2f0f..8419bc43 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -462,11 +462,15 @@ wifi_new_auto_connection (NMDevice *device,
 
        connection = nm_simple_connection_new ();
 
-       /* Make the new connection available only for the current user */
        s_con = (NMSettingConnection *) nm_setting_connection_new ();
-       nm_setting_connection_add_permission (s_con, "user", g_get_user_name (), NULL);
        nm_connection_add_setting (connection, NM_SETTING (s_con));
 
+       if (applet->permissions[NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM]
+           != NM_CLIENT_PERMISSION_RESULT_YES) {
+               /* Make the new connection available only for the current user */
+               nm_setting_connection_add_permission (s_con, "user", g_get_user_name (), NULL);
+       }
+
        ssid = nm_access_point_get_ssid (ap);
        if (   (nm_access_point_get_mode (ap) == NM_802_11_MODE_INFRA)
            && (is_manufacturer_default_ssid (ssid) == TRUE)) {


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