Hello community,

here is the log from the commit of package kwallet for openSUSE:Factory checked 
in at 2020-01-27 00:20:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kwallet (Old)
 and      /work/SRC/openSUSE:Factory/.kwallet.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kwallet"

Mon Jan 27 00:20:16 2020 rev:79 rq:766488 version:5.66.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kwallet/kwallet.changes  2020-01-14 
21:05:38.446717250 +0100
+++ /work/SRC/openSUSE:Factory/.kwallet.new.26092/kwallet.changes       
2020-01-27 00:20:18.597397279 +0100
@@ -1,0 +2,9 @@
+Tue Jan 21 12:05:27 UTC 2020 - Mykola Krachkovsky <[email protected]>
+
+- Add upstream patch to fix twice anchored regexp's
+  * d4980443755f5df63b6a13f662df169797f2684f.patch
+- Add upstream patch to revert QRegExp::Wildcard to solve problem with
+  listing of entries using QRegularExpression::wildcardToRegularExpression
+  * 02ab54ea6fe8b61a4e474070061d6e41aebc71a0.patch
+
+-------------------------------------------------------------------

New:
----
  02ab54ea6fe8b61a4e474070061d6e41aebc71a0.patch
  d4980443755f5df63b6a13f662df169797f2684f.patch

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

Other differences:
------------------
++++++ kwallet.spec ++++++
--- /var/tmp/diff_new_pack.ZnzCvV/_old  2020-01-27 00:20:21.073399392 +0100
+++ /var/tmp/diff_new_pack.ZnzCvV/_new  2020-01-27 00:20:21.073399392 +0100
@@ -36,6 +36,10 @@
 Source2:        frameworks.keyring
 %endif
 Source99:       baselibs.conf
+# PATCH-FIX-UPSTREAM - https://phabricator.kde.org/D26707 - Fix 
QRegularExpression::wildcardToRegularExpression() usage
+Patch1:         d4980443755f5df63b6a13f662df169797f2684f.patch
+# PATCH-FIX-UPSTREAM - https://phabricator.kde.org/D26734 - Revert 
readEntryList() to use QRegExp::Wildcard
+Patch2:         02ab54ea6fe8b61a4e474070061d6e41aebc71a0.patch
 BuildRequires:  cmake >= 3.0
 BuildRequires:  extra-cmake-modules >= %{_kf5_bugfix_version}
 BuildRequires:  fdupes
@@ -136,6 +140,7 @@
 
 %prep
 %setup -q
+%autopatch -p1
 
 %build
   %cmake_kf5 -d build

++++++ 02ab54ea6fe8b61a4e474070061d6e41aebc71a0.patch ++++++
>From 02ab54ea6fe8b61a4e474070061d6e41aebc71a0 Mon Sep 17 00:00:00 2001
From: Ahmad Samir <[email protected]>
Date: Fri, 17 Jan 2020 20:20:38 +0200
Subject: Revert readEntryList() to use QRegExp::Wildcard

Summary:
The issue with QRegularExpression::wildcardToRegularExpression() is
that it's more strict in its interpretation of a wildcard, i.e. it
makes it correctly work with file globbing patterns, meaning it would
return this pattern "\\A(?:[^/]*)\\z" when called with "*", it excludes
"/" which is a forbidden character in a filename, and it anchors the pattern
(which is what users of QRegExp did by using QRegExp::exactMatch()).
readEntryList() uses the regex to match against entries of the form:
WEBSITE / USERNAME, which includes a "/".

Test Plan:
- Install falkon (and falkon-kde for kwallet integration, or whatever
  your distro calls it) and log in to a website with a user name and a
  password and select to remember it when asked to.
- Restart falkon and see if the login data is shown

with this patch it should show the login data.

Reviewers: #frameworks, dfaure, apol

Reviewed By: dfaure

Subscribers: blaze, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D26734
---
 src/api/KWallet/kwallet.cpp                    | 6 ++----
 src/runtime/kwalletd/backend/kwalletbackend.cc | 8 +++-----
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/api/KWallet/kwallet.cpp b/src/api/KWallet/kwallet.cpp
index 7d4940f..8e4e3c3 100644
--- a/src/api/KWallet/kwallet.cpp
+++ b/src/api/KWallet/kwallet.cpp
@@ -176,15 +176,13 @@ public:
         attrs[KSS_ATTR_ENTRYFOLDER] = folder;
         KSecretsService::SearchCollectionItemsJob *searchItemsJob = 
secretsCollection->searchItems(attrs);
         if (searchItemsJob->exec()) {
-            const QRegularExpression 
re(QRegularExpression::wildcardToRegularExpression(key));
+            const QRegExp re(key, Qt::CaseSensitive, QRegExp::Wildcard);
             const auto list = searchItemsJob->items();
-            QRegularExpressionMatch match;
             for (KSecretsService::SearchCollectionItemsJob::Item item : list) {
                 KSecretsService::ReadItemPropertyJob *readLabelJob = 
item->label();
                 if (readLabelJob->exec()) {
                     QString label = readLabelJob->propertyValue().toString();
-                    match = re.match(label);
-                    if (match.hasMatch()) {
+                    if (re.exactMatch(label)) {
                         if (verb(this, label, item.data())) {
                             rc = 0; // one successful iteration already 
produced results, so success return
                         }
diff --git a/src/runtime/kwalletd/backend/kwalletbackend.cc 
b/src/runtime/kwalletd/backend/kwalletbackend.cc
index f30f887..5e2aa07 100644
--- a/src/runtime/kwalletd/backend/kwalletbackend.cc
+++ b/src/runtime/kwalletd/backend/kwalletbackend.cc
@@ -35,7 +35,7 @@
 #include <QFile>
 #include <QFileInfo>
 #include <QSaveFile>
-#include <QRegularExpression>
+#include <QRegExp>
 #include <QCryptographicHash>
 #include <QStandardPaths>
 
@@ -530,13 +530,11 @@ QList<Entry *> Backend::readEntryList(const QString &key)
         return rc;
     }
 
-    QRegularExpression 
re(QRegularExpression::wildcardToRegularExpression(key));
+    const QRegExp re(key, Qt::CaseSensitive, QRegExp::Wildcard);
 
     const EntryMap &map = _entries[_folder];
-    QRegularExpressionMatch match;
     for (EntryMap::ConstIterator i = map.begin(); i != map.end(); ++i) {
-        match = re.match(i.key());
-        if (match.hasMatch()) {
+        if (re.exactMatch(i.key())) {
             rc.append(i.value());
         }
     }
-- 
cgit v1.1

++++++ d4980443755f5df63b6a13f662df169797f2684f.patch ++++++
>From d4980443755f5df63b6a13f662df169797f2684f Mon Sep 17 00:00:00 2001
From: Ahmad Samir <[email protected]>
Date: Wed, 15 Jan 2020 22:50:10 +0200
Subject: Fix QRegularExpression::wildcardToRegularExpression() usage
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Summary:
It turns out that QRegularExpression::wildcardToRegularExpression() returns
an anchored (with \A and \z) pattern, so using anchoredPattern() in such
cases would actually anchor the pattern twice, which is obviously wrong.
Thanks to Mikołaj Płomieński (blaze) for catching it in
https://phabricator.kde.org/D26205#594891

Test Plan: make && ctest

Reviewers: #frameworks, apol, dfaure

Reviewed By: apol

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D26707
---
 src/api/KWallet/kwallet.cpp                    | 3 +--
 src/runtime/kwalletd/backend/kwalletbackend.cc | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/api/KWallet/kwallet.cpp b/src/api/KWallet/kwallet.cpp
index d21c488..7d4940f 100644
--- a/src/api/KWallet/kwallet.cpp
+++ b/src/api/KWallet/kwallet.cpp
@@ -176,8 +176,7 @@ public:
         attrs[KSS_ATTR_ENTRYFOLDER] = folder;
         KSecretsService::SearchCollectionItemsJob *searchItemsJob = 
secretsCollection->searchItems(attrs);
         if (searchItemsJob->exec()) {
-            const QRegularExpression re(QRegularExpression::anchoredPattern(
-                                          
QRegularExpression::wildcardToRegularExpression(key)));
+            const QRegularExpression 
re(QRegularExpression::wildcardToRegularExpression(key));
             const auto list = searchItemsJob->items();
             QRegularExpressionMatch match;
             for (KSecretsService::SearchCollectionItemsJob::Item item : list) {
diff --git a/src/runtime/kwalletd/backend/kwalletbackend.cc 
b/src/runtime/kwalletd/backend/kwalletbackend.cc
index 3681724..f30f887 100644
--- a/src/runtime/kwalletd/backend/kwalletbackend.cc
+++ b/src/runtime/kwalletd/backend/kwalletbackend.cc
@@ -530,8 +530,7 @@ QList<Entry *> Backend::readEntryList(const QString &key)
         return rc;
     }
 
-    QRegularExpression re(QRegularExpression::anchoredPattern(
-                           
QRegularExpression::wildcardToRegularExpression(key)));
+    QRegularExpression 
re(QRegularExpression::wildcardToRegularExpression(key));
 
     const EntryMap &map = _entries[_folder];
     QRegularExpressionMatch match;
-- 
cgit v1.1




Reply via email to