From: Lennart Poettering Date: Thu, 3 Jun 2021 08:42:55 +0000 (+0200) Subject: ask-password: default to a different prompt than "Password:" if the echo is on X-Git-Tag: v249-rc1~105^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a51168481f2e3bcda2c18c2f2edae311caee495b;p=thirdparty%2Fsystemd.git ask-password: default to a different prompt than "Password:" if the echo is on --- diff --git a/src/ask-password/ask-password.c b/src/ask-password/ask-password.c index fb4b7be4fcb..db6f2f59c0a 100644 --- a/src/ask-password/ask-password.c +++ b/src/ask-password/ask-password.c @@ -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;