diff options
author | Jiří Klimeš <jklimes@redhat.com> | 2015-12-11 13:13:49 +0100 |
---|---|---|
committer | Jiří Klimeš <jklimes@redhat.com> | 2015-12-11 13:13:49 +0100 |
commit | 072336f8c26b8b8fbcfa8b7a008a649eaa03bb52 (patch) | |
tree | 970a9bd0dce2a5826f11a99f9a99dbe652a0d265 | |
parent | b3f3b805cb24f05ecc9fee4e8c6521fe5849d76b (diff) | |
download | NetworkManager-jk/clients-vpn-secrets-rh975185.tar.gz |
cli: do not present secrets from openconnect to the user for confirmationjk/clients-vpn-secrets-rh975185
It is pointless to present them and require user to press Return for each
password prompt.
-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 8c7dbaf3e2..661f8a4845 100644 --- a/clients/cli/common.c +++ b/clients/cli/common.c @@ -1012,17 +1012,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_echo (echo_on, "%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); |