mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 05:50:08 +01:00
clients: don't show "(null)" prompt for secrets
If the caller doesn't provide a message, simply don't show it.
This commit is contained in:
parent
b28b2ba8a9
commit
a80af27fc9
2 changed files with 6 additions and 3 deletions
|
|
@ -96,7 +96,8 @@ get_secrets_from_user (const char *request_id,
|
|||
char *pwd = NULL;
|
||||
|
||||
/* Ask user for the password */
|
||||
g_print ("%s\n", msg);
|
||||
if (msg)
|
||||
g_print ("%s\n", msg);
|
||||
if (secret->value) {
|
||||
/* Prefill the password if we have it. */
|
||||
rl_startup_hook = set_deftext;
|
||||
|
|
|
|||
|
|
@ -1058,13 +1058,15 @@ get_secrets_from_user (const char *request_id,
|
|||
nmc_rl_pre_input_deftext = g_strdup (secret->value);
|
||||
}
|
||||
}
|
||||
g_print ("%s\n", msg);
|
||||
if (msg)
|
||||
g_print ("%s\n", msg);
|
||||
pwd = nmc_readline_echo (secret->password ? echo_on : TRUE,
|
||||
"%s (%s): ", secret->name, secret->prop_name);
|
||||
if (!pwd)
|
||||
pwd = g_strdup ("");
|
||||
} else {
|
||||
g_print ("%s\n", msg);
|
||||
if (msg)
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue