Hello community,

here is the log from the commit of package ksshaskpass5 for openSUSE:Factory 
checked in at 2020-07-06 16:18:28
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ksshaskpass5 (Old)
 and      /work/SRC/openSUSE:Factory/.ksshaskpass5.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ksshaskpass5"

Mon Jul  6 16:18:28 2020 rev:96 rq:818565 version:5.19.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/ksshaskpass5/ksshaskpass5.changes        
2020-06-25 15:05:01.140897009 +0200
+++ /work/SRC/openSUSE:Factory/.ksshaskpass5.new.3060/ksshaskpass5.changes      
2020-07-06 16:19:27.985350431 +0200
@@ -1,0 +2,7 @@
+Mon Jun 29 08:19:17 UTC 2020 - Fabian Vogt <fab...@ritter-vogt.de>
+
+- Add patches to address regressions:
+  * 0001-Bring-back-for-saving-usernames-as-well.patch
+  * 0002-Migrate-away-from-singe-quote-identifiers-as-well.patch
+
+-------------------------------------------------------------------

New:
----
  0001-Bring-back-for-saving-usernames-as-well.patch
  0002-Migrate-away-from-singe-quote-identifiers-as-well.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ksshaskpass5.spec ++++++
--- /var/tmp/diff_new_pack.DEICq0/_old  2020-07-06 16:19:31.029359782 +0200
+++ /var/tmp/diff_new_pack.DEICq0/_new  2020-07-06 16:19:31.033359795 +0200
@@ -29,7 +29,11 @@
 Source1:        
https://download.kde.org/stable/plasma/%{version}/ksshaskpass-%{version}.tar.xz.sig
 Source2:        plasma.keyring
 %endif
+# PATCH-FIX-OPENSUSE
 Patch1:         suse-tweaks.diff
+# PATCH-FIX-UPSTREAM
+Patch2:         0001-Bring-back-for-saving-usernames-as-well.patch
+Patch3:         0002-Migrate-away-from-singe-quote-identifiers-as-well.patch
 BuildRequires:  extra-cmake-modules
 BuildRequires:  kf5-filesystem
 BuildRequires:  cmake(KF5CoreAddons)
@@ -54,9 +58,9 @@
 A Plasma 5 version of ssh-askpass with KWallet support.
 
 %lang_package
+
 %prep
-%setup -q -n ksshaskpass-%{version}
-%patch1 -p1
+%autosetup -p1 -n ksshaskpass-%{version}
 
 %build
   %cmake_kf5 -d build -- -DCMAKE_INSTALL_LOCALEDIR=%{_kf5_localedir}

++++++ 0001-Bring-back-for-saving-usernames-as-well.patch ++++++
>From ed482e075ff10bef64356a52bfa9ef0472e9e729 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fab...@ritter-vogt.de>
Date: Mon, 29 Jun 2020 10:10:24 +0200
Subject: [PATCH 1/2] Bring back for saving usernames as well

While this also reintroduces that a password field is used for entering, this
is better than asking for the username every time, which is a regression
compared to 5.18.

Using a proper username input field would need changes in kwidgetsaddons or
some refactoring to ask for username and password at once.

Drop use of wallet->readEntry - it's custom binary data, so the content is
entirely defined by whoever wrote it. We don't use writeEntry here, so using
readEntry is invalud.
---
 src/main.cpp | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index 3e3149e..148eae3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -304,17 +304,11 @@ int main(int argc, char **argv)
         wallet->setFolder(walletFolder);
 
         QString retrievedItem;
-        if (type != TypePassword) {
-            QByteArray retrievedBytes;
-            wallet->readEntry(identifier, retrievedBytes);
-            retrievedItem = QString::fromUtf8(retrievedBytes);
-        } else {
-            wallet->readPassword(identifier, retrievedItem);
-        }
+        wallet->readPassword(identifier, retrievedItem);
 
         if (!retrievedItem.isEmpty()) {
             item = retrievedItem;
-        } else if (type == TypePassword) {
+        } 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.
@@ -343,15 +337,10 @@ int main(int argc, char **argv)
             item = QStringLiteral("yes\n");
             break;
         }
-        case TypeClearText: {
-            bool ok = false;
-            item = QInputDialog::getText(0, i18n("Ksshaskpass"), dialog, 
QLineEdit::Normal, QString(), &ok);
-            if (!ok) {
-                // dialog has been canceled
-                return 1;
-            }
-            break;
-        }
+        case TypeClearText:
+            // Should use a dialog with visible input, but KPasswordDialog 
doesn't support that and
+            // other available dialog types don't have a "Keep" checkbox.
+            /* fallthrough */
         case TypePassword: {
             // create the password dialog, but only show "Enable Keep" button, 
if the wallet is open
             KPasswordDialog::KPasswordDialogFlag 
flag(KPasswordDialog::NoFlags);
-- 
2.25.1

++++++ 0002-Migrate-away-from-singe-quote-identifiers-as-well.patch ++++++
>From 45cffb3ce590f6893426aa172a28e66e465d917a Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fab...@ritter-vogt.de>
Date: Mon, 29 Jun 2020 10:55:09 +0200
Subject: [PATCH 2/2] Migrate away from singe quote identifiers as well

Refactor the code a bit while at it.
---
 src/main.cpp | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/main.cpp b/src/main.cpp
index 148eae3..ab4fcf3 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -303,21 +303,21 @@ int main(int argc, char **argv)
     if ((!ignoreWallet) && (!identifier.isNull()) && wallet.get() && 
wallet->hasFolder(walletFolder)) {
         wallet->setFolder(walletFolder);
 
-        QString retrievedItem;
-        wallet->readPassword(identifier, retrievedItem);
-
-        if (!retrievedItem.isEmpty()) {
-            item = retrievedItem;
-        } 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
+        wallet->readPassword(identifier, item);
+
+        if (item.isEmpty()) {
+            // There was a bug in previous versions of ksshaskpass that caused 
it to create keys with single quotes
+            // around the identifier and even older versions have an extra 
space appended to the identifier.
+            // key file name. Try these keys too, and, if there's a match, 
ensure that it's properly
             // replaced with proper one.
-            const QString keyFile = identifier + QLatin1Char(' ');
-            wallet->readPassword(keyFile, retrievedItem);
-            if (!retrievedItem.isEmpty()) {
-                qCWarning(LOG_KSSHASKPASS) << "Detected legacy key for " << 
identifier << ", enabling workaround";
-                item = retrievedItem;
-                wallet->renameEntry(keyFile, identifier);
+            for(auto templ : QStringList{QStringLiteral("'%0'"), 
QStringLiteral("%0 "), QStringLiteral("'%0' ")}) {
+                const QString keyFile = templ.arg(identifier);
+                wallet->readPassword(keyFile, item);
+                if (!item.isEmpty()) {
+                    qCWarning(LOG_KSSHASKPASS) << "Detected legacy key for " 
<< identifier << ", enabling workaround";
+                    wallet->renameEntry(keyFile, identifier);
+                    break;
+                }
             }
         }
     }
-- 
2.25.1




Reply via email to