From cbc5ffefeca630ef1af4d40cabf8e3198f294bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Sun, 24 Jul 2016 15:14:25 +0200 Subject: [PATCH] cli: show pre-filled readline input if it is not a real password (rh #1351272) Example: $ nmcli -a con up test-conn Passwords or encryption keys are required to access the wireless network 'kkk'. Username (802-1x.identity): cimrman Password (802-1x.password): https://bugzilla.redhat.com/show_bug.cgi?id=1351272 (cherry picked from commit c9f630991071b71cae9d03650c8492d28bb3eb56) --- clients/cli/common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clients/cli/common.c b/clients/cli/common.c index 05b765647d..98e962cc29 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -1041,7 +1041,8 @@ get_secrets_from_user (const char *request_id, } } g_print ("%s\n", msg); - pwd = nmc_readline_echo (echo_on, "%s (%s): ", secret->name, secret->prop_name); + pwd = nmc_readline_echo (secret->password ? echo_on : TRUE, + "%s (%s): ", secret->name, secret->prop_name); if (!pwd) pwd = g_strdup (""); } else {