SSH: Add ssh-askpass implementation

There is no standard implementation for the ssh-askpass tool on any
platform, so we currently can't find one on our own. In particular, this
means that the RemoteLinux device test will always fail for a newly
added device, which is not acceptable.
So we just add our own askpass implementation and point the SSH settings
to it.

Change-Id: I7ca18725e63f591ef9defdf13768a21cc3de4a54
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2018-12-18 17:47:51 +01:00
parent 8331b98dbb
commit b958b9b669
8 changed files with 99 additions and 19 deletions

View File

@@ -40,8 +40,13 @@ namespace Internal {
SshProcess::SshProcess()
{
Utils::Environment env = Utils::Environment::systemEnvironment();
if (SshSettings::askpassFilePath().exists())
if (SshSettings::askpassFilePath().exists()) {
env.set("SSH_ASKPASS", SshSettings::askpassFilePath().toUserOutput());
// OpenSSH only uses the askpass program if DISPLAY is set, regardless of the platform.
if (!env.hasKey("DISPLAY"))
env.set("DISPLAY", ":0");
}
setProcessEnvironment(env.toProcessEnvironment());
}