diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-12-11 13:13:49 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-12-12 22:30:48 +0100 |
commit | 19756e874d9c5c2d1fa3a7db63cef3818844e6c6 (patch) | |
tree | fd8673114f06af2b596b7852295c9d8dd220cbe1 | |
parent | 7acbf23b89e651355c9ef243f4576521d0f04a4e (diff) | |
download | NetworkManager-19756e874d9c5c2d1fa3a7db63cef3818844e6c6.tar.gz |
cli: do not present secrets from openconnect to the user for confirmation
It is pointless to present them and require user to press Return for each
password prompt.
(cherry picked from commit fb62fc76cbd6ebd2807976e6ca545e465118f8d1)
-rw-r--r-- | clients/cli/common.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/clients/cli/common.c b/clients/cli/common.c index 705793c5ef..86f91d5869 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -1027,17 +1027,23 @@ get_secrets_from_user (const char *request_id, if (pwds_hash && (pwd = g_hash_table_lookup (pwds_hash, secret->prop_name))) { pwd = g_strdup (pwd); } else { - g_print ("%s\n", msg); if (ask) { if (secret->value) { - /* Prefill the password if we have it. */ - rl_startup_hook = nmc_rl_set_deftext; - nmc_rl_pre_input_deftext = g_strdup (secret->value); + if (!g_strcmp0 (secret->vpn_type, NM_DBUS_INTERFACE ".openconnect")) { + /* Do not present and ask user for openconnect secrets, we already have them */ + continue; + } else { + /* Prefill the password if we have it. */ + rl_startup_hook = nmc_rl_set_deftext; + nmc_rl_pre_input_deftext = g_strdup (secret->value); + } } + g_print ("%s\n", msg); pwd = nmc_readline ("%s (%s): ", secret->name, secret->prop_name); if (!pwd) pwd = g_strdup (""); } else { + g_print ("%s\n", msg); g_printerr (_("Warning: password for '%s' not given in 'passwd-file' " "and nmcli cannot ask without '--ask' option.\n"), secret->prop_name); |