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 c9f6309910)
This commit is contained in:
Jiří Klimeš 2016-07-24 15:14:25 +02:00
parent 8540ca3a8a
commit cbc5ffefec

View file

@ -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 {