Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=kde5.git;a=commitdiff;h=7d3a5f157801f19db8a5236297c07981f44e7d62
commit 7d3a5f157801f19db8a5236297c07981f44e7d62 Author: crazy <[email protected]> Date: Tue Feb 28 20:59:12 2017 +0100 ksshaskpass5-5.9.3-1-x86_64 * Version bump diff --git a/source/plasma/ksshaskpass5/FrugalBuild b/source/plasma/ksshaskpass5/FrugalBuild index 4a8850c..5eca986 100644 --- a/source/plasma/ksshaskpass5/FrugalBuild +++ b/source/plasma/ksshaskpass5/FrugalBuild @@ -2,17 +2,16 @@ # Maintainer: DeX77 <[email protected]> pkgname=ksshaskpass5 -pkgver=5.9.2 -pkgrel=2 +pkgver=5.9.3 +pkgrel=1 pkgdesc="Kf5 implementation of ssh-askpass with Kwallet integration" archs=("x86_64") groups=('plasma') _F_kde_project="plasma" Finclude kf5 -source+=(ksshaskpass5.sh fix-ssh-add.patch) -sha1sums=('11b7daacc1dba76c1b4ba28dbabfac88005d0249' \ - '31f920035ed660750baa66c027865c4296e9d73e' \ - '4780b7e266696f8b8787bf6bd326b58d9b9f7157') +source+=(ksshaskpass5.sh) +sha1sums=('8bfe213c1e3fcb6a9063082f98cc62de05fb706f' \ + '31f920035ed660750baa66c027865c4296e9d73e') depends=("kwallet5>=$_F_kf5_full") makedepends+=("kdoctools>=$_F_kf5_full") diff --git a/source/plasma/ksshaskpass5/fix-ssh-add.patch b/source/plasma/ksshaskpass5/fix-ssh-add.patch deleted file mode 100644 index c3400ad..0000000 --- a/source/plasma/ksshaskpass5/fix-ssh-add.patch +++ /dev/null @@ -1,187 +0,0 @@ -diff --git a/src/main.cpp b/src/main.cpp -index 9739ce9..ff7ff6f 100644 ---- a/src/main.cpp -+++ b/src/main.cpp -@@ -1,172 +1,181 @@ - /*************************************************************************** - * Copyright (C) 2006 Hans van Leeuwen <[email protected]> * - * Copyright (C) 2008-2010 Armin Berres <[email protected]> * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - ***************************************************************************/ - - #include <sys/resource.h> - #include <memory> - - #include <kwallet.h> - #include <KPasswordDialog> - #include <KAboutData> - #include <KLocalizedString> - - #include <QApplication> - #include <QCommandLineParser> - #include <QTextStream> - #include <QCommandLineOption> - #include <QPointer> - #include <QRegularExpression> - #include <QLoggingCategory> - - Q_LOGGING_CATEGORY(LOG_KSSHASKPASS, "ksshaskpass") - - // Try to understand what we're asked for by parsing the phrase. Unfortunately, sshaskpass interface does not - // include any saner methods to pass the action or the name of the keyfile. Fortunately, at least Debian's ssh-add - // has no i18n, so this should work for all languages as long as the string is unchanged. - static void parsePrompt(const QString &prompt, QString& keyFile, bool& wrongPassphrase) - { - // Case 1: asking for passphrase for a certain keyfile for the first time => we should try a password from the wallet - QRegularExpression re1("^Enter passphrase for (.*?)( \\(will confirm each use\\))?: $"); - QRegularExpressionMatch match1 = re1.match(prompt); - if (match1.hasMatch()) { - keyFile = match1.captured(1); - wrongPassphrase = false; - return; - } - - // Case 2: re-asking for passphrase for a certain keyfile => probably we've tried a password from the wallet, no point - // in trying it again - QRegularExpression re2("^Bad passphrase, try again for (.*?)( \\(will confirm each use\\))?: $"); - QRegularExpressionMatch match2 = re2.match(prompt); - if (match2.hasMatch()) { - keyFile = match2.captured(1); - wrongPassphrase = true; - 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; - } - - int main(int argc, char **argv) - { - KLocalizedString::setApplicationDomain("ksshaskpass"); - - //TODO update it. - KAboutData about( - QStringLiteral("ksshaskpass"), - i18n("Ksshaskpass"), - PROJECT_VERSION, - i18n("KDE version of ssh-askpass"), - KAboutLicense::GPL, - i18n("(c) 2006 Hans van Leeuwen\n(c) 2008-2010 Armin Berres"), - i18n("Ksshaskpass allows you to interactively prompt users for a passphrase for ssh-add"), - QStringLiteral("http://www.kde-apps.org/content/show.php?action=content&content=50971"), - QStringLiteral("[email protected]") - ); - - about.addAuthor(i18n("Armin Berres"), i18n("Current author"), QStringLiteral("[email protected]"), 0); - about.addAuthor(i18n("Hans van Leeuwen"), i18n("Original author"), QStringLiteral("[email protected]"), 0); - - QCommandLineParser parser; - QApplication app(argc, argv); - KAboutData::setApplicationData(about); - parser.addVersionOption(); - parser.addHelpOption(); - parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("+[prompt]"), i18nc("Name of a prompt for a password", "Prompt"))); - - about.setupCommandLine(&parser); - parser.process(app); - about.processCommandLine(&parser); - - const QString walletFolder = app.applicationName(); - QString dialog = i18n("Please enter passphrase"); // Default dialog text. - QString keyFile; - QString password; - bool wrongPassphrase = false; - - // Parse commandline arguments - if (!parser.positionalArguments().isEmpty()) { - dialog = parser.positionalArguments().at(0); - parsePrompt(dialog, keyFile, wrongPassphrase); - } - - // Open KWallet to see if a password was previously stored - std::auto_ptr<KWallet::Wallet> wallet(KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), 0)); - - if ((!wrongPassphrase) && (!keyFile.isNull()) && wallet.get() && wallet->hasFolder(walletFolder)) { - wallet->setFolder(walletFolder); - - QString retrievedPass; - wallet->readPassword(keyFile, retrievedPass); - - if (!retrievedPass.isEmpty()) { - password = retrievedPass; - } else { - // There was a bug in previous versions of ksshaskpass that caused it to create keys with extra space - // appended to key file name. Try these keys too, and, if there's a match, ensure that it's properly - // replaced with proper one. - const QString keyFile2 = keyFile + " "; - wallet->readPassword(keyFile2, retrievedPass); - if (!retrievedPass.isEmpty()) { - qCWarning(LOG_KSSHASKPASS) << "Detected legacy key for " << keyFile << ", enabling workaround"; - password = retrievedPass; - wallet->renameEntry(keyFile2, keyFile); - } - } - } - - // Password could not be retrieved from wallet. Open password dialog - if (password.isEmpty()) { - // create the password dialog, but only show "Enable Keep" button, if the wallet is open - KPasswordDialog::KPasswordDialogFlag flag(KPasswordDialog::NoFlags); - if (wallet.get()) { - flag = KPasswordDialog::ShowKeepPassword; - } - QPointer<KPasswordDialog> kpd = new KPasswordDialog(0, flag); - - kpd->setPrompt(dialog); - kpd->setWindowTitle(i18n("Ksshaskpass")); - // We don't want to dump core when the password dialog is shown, because it could contain the entered password. - // KPasswordDialog::disableCoreDumps() seems to be gone in KDE 4 -- do it manually - struct rlimit rlim; - rlim.rlim_cur = rlim.rlim_max = 0; - setrlimit(RLIMIT_CORE, &rlim); - - if (kpd->exec() == QDialog::Accepted) { - password = kpd->password(); - // If "Enable Keep" is enabled, open/create a folder in KWallet and store the password. - if ((!keyFile.isNull()) && wallet.get() && kpd->keepPassword()) { - if (!wallet->hasFolder(walletFolder)) { - wallet->createFolder(walletFolder); - } - wallet->setFolder(walletFolder); - wallet->writePassword(keyFile, password); - } - } else { - // dialog has been canceled - return 1; - } - } - - QTextStream out(stdout); - out << password; - return 0; - } - _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
