The unified diff between revisions [78d02301..] and [833d0ade..] is displayed below. It can also be downloaded as a raw diff.
This diff has been restricted to the following files: 'cli-authpasswd.c'
#
#
# patch "cli-authpasswd.c"
# from [44b789137e747da6332f48cea540d886d81d14e4]
# to [a0f36f9a50791c9833ff3926c821a254a49daad1]
#
============================================================
--- cli-authpasswd.c 44b789137e747da6332f48cea540d886d81d14e4
+++ cli-authpasswd.c a0f36f9a50791c9833ff3926c821a254a49daad1
@@ -38,7 +38,9 @@ static int want_askpass()
char* askpass_prog = NULL;
askpass_prog = getenv("SSH_ASKPASS");
- return askpass_prog && !isatty(STDIN_FILENO) && getenv("DISPLAY");
+ return askpass_prog &&
+ ((!isatty(STDIN_FILENO) && getenv("DISPLAY") )
+ || getenv("SSH_ASKPASS_ALWAYS"));
}
/* returns a statically allocated password from a helper app, or NULL
@@ -125,10 +127,16 @@ void cli_auth_password() {
cli_opts.username, cli_opts.remotehost);
#ifdef ENABLE_CLI_ASKPASS_HELPER
if (want_askpass())
+ {
password = gui_getpass(prompt);
- else
+ if (!password) {
+ dropbear_exit("No password");
+ }
+ } else
#endif
+ {
password = getpass_or_cancel(prompt);
+ }
buf_putbyte(ses.writepayload, SSH_MSG_USERAUTH_REQUEST);