forked from qt-creator/qt-creator
SSH: Fix Askpass on Windows 11
The standard openssh on windows 11 will not use the "askpass" unless SSH_ASKPASS_REQUIRE is set to "force". see: https://github.com/PowerShell/Win32-OpenSSH/issues/2115 Change-Id: I96a32e333a39e0cf5f5dab4c0f9c201b20daf533 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -77,6 +77,7 @@ bool SshParameters::setupSshEnvironment(Process *process)
|
|||||||
const bool hasDisplay = env.hasKey("DISPLAY") && (env.value("DISPLAY") != QString(":0"));
|
const bool hasDisplay = env.hasKey("DISPLAY") && (env.value("DISPLAY") != QString(":0"));
|
||||||
if (SshSettings::askpassFilePath().exists()) {
|
if (SshSettings::askpassFilePath().exists()) {
|
||||||
env.set("SSH_ASKPASS", SshSettings::askpassFilePath().toUserOutput());
|
env.set("SSH_ASKPASS", SshSettings::askpassFilePath().toUserOutput());
|
||||||
|
env.set("SSH_ASKPASS_REQUIRE", "force");
|
||||||
|
|
||||||
// OpenSSH only uses the askpass program if DISPLAY is set, regardless of the platform.
|
// OpenSSH only uses the askpass program if DISPLAY is set, regardless of the platform.
|
||||||
if (!env.hasKey("DISPLAY"))
|
if (!env.hasKey("DISPLAY"))
|
||||||
|
|||||||
@@ -751,8 +751,10 @@ FilePath source(IDocument *document)
|
|||||||
void setProcessEnvironment(Environment *e)
|
void setProcessEnvironment(Environment *e)
|
||||||
{
|
{
|
||||||
const QString prompt = Internal::commonSettings().sshPasswordPrompt().path();
|
const QString prompt = Internal::commonSettings().sshPasswordPrompt().path();
|
||||||
if (!prompt.isEmpty())
|
if (!prompt.isEmpty()) {
|
||||||
e->set("SSH_ASKPASS", prompt);
|
e->set("SSH_ASKPASS", prompt);
|
||||||
|
e->set("SSH_ASKPASS_REQUIRE", "force");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace VcsBase
|
} // namespace VcsBase
|
||||||
|
|||||||
Reference in New Issue
Block a user