Relax implicit ASKPASS requirements for X11 forwarding scenarios (#428)

This commit is contained in:
Rafael Rivera 2020-02-27 16:19:59 -08:00 committed by GitHub
parent a4e42bd33a
commit 5207e6f1be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -183,10 +183,19 @@ read_passphrase(const char *prompt, int flags)
askpass = getenv(SSH_ASKPASS_ENV);
else
askpass = _PATH_SSH_ASKPASS_DEFAULT;
#ifdef WINDOWS
if (getenv(SSH_ASKPASS_ENV)) {
#endif
if ((ret = ssh_askpass(askpass, prompt)) == NULL)
if (!(flags & RP_ALLOW_EOF))
return xstrdup("");
return ret;
#ifdef WINDOWS
}
#endif
}
if (readpassphrase(prompt, buf, sizeof buf, rppflags) == NULL) {