summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2022-05-12 12:31:32 +0200
committerLubomir Rintel <lkundrak@v3.sk>2022-05-12 14:37:25 +0200
commitbf9a11f7c75782b1b1b9228a0d8606567d5c6706 (patch)
tree3940883b78575e4ebce3b65aaca35b6c75df6dd1
parent2dbbea3f10893545d054f56f101cb91c2c2185c2 (diff)
nmcli/devices: check connection created with "wifi connect"
We want to warn the user if they're connecting to an insecure network: $ nmcli d wifi IN-USE BSSID SSID MODE CHAN RATE SIGNAL BARS SECURITY BA:00:6A:3C:C2:09 Secured Network Infra 2 54 Mbit/s 100 ▂▄▆█ WPA3 FA:7C:46:CC:9F:BE Ye Olde Wlan Infra 1 54 Mbit/s 100 ▂▄▆█ WEP $ nmcli d wifi connect 'Ye Olde Wlan' Warning: WEP encryption is known to be insecure. ... https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1224
-rw-r--r--src/nmcli/devices.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nmcli/devices.c b/src/nmcli/devices.c
index 2bfc4cece3..8a4e942281 100644
--- a/src/nmcli/devices.c
+++ b/src/nmcli/devices.c
@@ -2127,6 +2127,7 @@ add_and_activate_cb(GObject *client, GAsyncResult *result, gpointer user_data)
NmCli *nmc = info->nmc;
gs_unref_object NMActiveConnection *active = NULL;
gs_free_error GError *error = NULL;
+ const char *deprecated;
if (info->create)
active = nm_client_add_and_activate_connection_finish(NM_CLIENT(client), result, &error);
@@ -2152,6 +2153,11 @@ add_and_activate_cb(GObject *client, GAsyncResult *result, gpointer user_data)
return;
}
+ deprecated =
+ nmc_connection_check_deprecated(NM_CONNECTION(nm_active_connection_get_connection(active)));
+ if (deprecated)
+ g_printerr(_("Warning: %s.\n"), deprecated);
+
if (nmc->nowait_flag) {
quit();
return;