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:
@ -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;
|
||||
|
Reference in New Issue
Block a user