1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-25 13:49:55 +03:00

ask-password: default to a different prompt than "Password:" if the echo is on

This commit is contained in:
Lennart Poettering
2021-06-03 10:42:55 +02:00
parent 49365d1c6d
commit a51168481f

View File

@ -200,6 +200,14 @@ static int parse_argv(int argc, char *argv[]) {
arg_message = strv_join(argv + optind, " ");
if (!arg_message)
return log_oom();
} else if (FLAGS_SET(arg_flags, ASK_PASSWORD_ECHO)) {
/* By default ask_password_auto() will query with the string "Password: ", which is not right
* when full echo is on, since then it's unlikely a password. Let's hence default to a less
* confusing string in that case. */
arg_message = strdup("Input:");
if (!arg_message)
return log_oom();
}
return 1;