Commit 408c284f authored by Christoph Feck's avatar Christoph Feck

Fix git ssh password detection

Investigation and patch by Idekel Santana.

BUG: 376228
FIXED-IN: 5.9.3

Differential Revision: https://phabricator.kde.org/D4540
parent d809e952
......@@ -59,7 +59,16 @@ static void parsePrompt(const QString &prompt, QString& keyFile, bool& wrongPass
return;
}
// Case 3: nothing matched; either it was called by some sort of a script with a custom prompt (i.e. not ssh-add), or
// Case 3: password extraction from git, see bug 376228
QRegularExpression re3("^(Password|Username) for (.*?)[:] $");
QRegularExpressionMatch match3 = re3.match(prompt);
if (match3.hasMatch()) {
keyFile = match3.captured(2);
wrongPassphrase = false;
return;
}
// Case 4: nothing matched; either it was called by some sort of a script with a custom prompt (i.e. not ssh-add), or
// strings we're looking for were broken. Issue a warning and continue without keyFile.
qCWarning(LOG_KSSHASKPASS) << "Unable to extract keyFile from phrase" << prompt;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment