From 77c508c8e76b7b4c6a2d3bc9a76d1e9072eb82e8 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 5 Jun 2024 15:06:08 +0200 Subject: [PATCH] libnmc/secret-agent-simple: advise if WPS PBC enrollment is active Print a different message on "nmcli --ask d wifi connect" if WPS enrollment is in progress. This is the same as GNOME Shell's secret agent (and perhaps others) do. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1961 --- src/libnmc-base/nm-secret-agent-simple.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libnmc-base/nm-secret-agent-simple.c b/src/libnmc-base/nm-secret-agent-simple.c index 9d1a2ae962..b6945de7d4 100644 --- a/src/libnmc-base/nm-secret-agent-simple.c +++ b/src/libnmc-base/nm-secret-agent-simple.c @@ -907,9 +907,15 @@ request_secrets_from_ui(RequestData *request) ssid_utf8 = nm_utils_ssid_to_utf8(g_bytes_get_data(ssid, NULL), g_bytes_get_size(ssid)); title = _("Authentication required by wireless network"); - msg = g_strdup_printf( - _("Passwords or encryption keys are required to access the wireless network '%s'."), - ssid_utf8); + if (request->flags & NM_SECRET_AGENT_GET_SECRETS_FLAG_WPS_PBC_ACTIVE) { + msg = g_strdup_printf(_("Push of the WPS button on the router or a password is " + "required to access the wireless network '%s'."), + ssid_utf8); + } else { + msg = g_strdup_printf( + _("Passwords or encryption keys are required to access the wireless network '%s'."), + ssid_utf8); + } if (!add_wireless_secrets(request, secrets)) goto out_fail;