Christophe Marin 2023-05-11 10:11:23 +00:00 committed by Git OBS Bridge
parent 829fd7a70f
commit 2022f7e2e8
13 changed files with 46 additions and 318 deletions

View File

@ -1,61 +0,0 @@
From 5d6bf9ab17c89bb42ba6dc579ea564d105c6efcb Mon Sep 17 00:00:00 2001
From: Christophe Marin <christophe@krop.fr>
Date: Fri, 28 Apr 2023 16:29:45 +0200
Subject: [PATCH] Allow running mysql_upgrade when starting Akonadi
Amends d6a1c057327332487adc9ad39252f9481ae28288
CCBUG: 402680
(cherry picked from commit 620ea58f76e00aed52c1acee9c8d11b6f3279953)
---
apparmor/mariadbd_akonadi | 3 ++-
apparmor/mysqld_akonadi | 1 +
apparmor/usr.bin.akonadiserver | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/apparmor/mariadbd_akonadi b/apparmor/mariadbd_akonadi
index b63465278..7c0497a3d 100644
--- a/apparmor/mariadbd_akonadi
+++ b/apparmor/mariadbd_akonadi
@@ -30,9 +30,10 @@ profile mariadbd_akonadi {
/{usr/,}bin/mkdir mrix,
/{usr/,}bin/sed mrix,
/usr/bin/my_print_defaults mrix,
- /usr/bin/mariadb-install-db mrix,
/usr/bin/mariadb-admin mrix,
/usr/bin/mariadb-check mrix,
+ /usr/bin/mariadb-install-db mrix,
+ /usr/bin/mariadb-upgrade mrix,
/usr/{,s}bin/mariadbd mrix,
/usr/share/mysql/** r,
owner @{xdg_data_home}/akonadi/** rwk,
diff --git a/apparmor/mysqld_akonadi b/apparmor/mysqld_akonadi
index 72949d025..4940bf4d2 100644
--- a/apparmor/mysqld_akonadi
+++ b/apparmor/mysqld_akonadi
@@ -31,6 +31,7 @@ profile mysqld_akonadi {
/{usr/,}bin/sed mrix,
/usr/bin/my_print_defaults mrix,
/usr/bin/mysql_install_db mrix,
+ /usr/bin/mysql_upgrade mrix,
/usr/bin/mysqladmin mrix,
/usr/bin/mysqlcheck mrix,
/usr/{,s}bin/mysqld mrix,
diff --git a/apparmor/usr.bin.akonadiserver b/apparmor/usr.bin.akonadiserver
index aa489a3d0..917d5bf78 100644
--- a/apparmor/usr.bin.akonadiserver
+++ b/apparmor/usr.bin.akonadiserver
@@ -46,8 +46,10 @@ abi <abi/3.0>,
/usr/bin/mariadb-admin Px -> mariadbd_akonadi,
/usr/bin/mariadb-check Px -> mariadbd_akonadi,
/usr/bin/mariadb-install-db Px -> mariadbd_akonadi,
+ /usr/bin/mariadb-upgrade Px -> mariadbd_akonadi,
/usr/{,s}bin/mariadbd Px -> mariadbd_akonadi,
/usr/bin/mysql_install_db Px -> mysqld_akonadi,
+ /usr/bin/mysql_upgrade Px -> mysqld_akonadi,
/usr/bin/mysqladmin Px -> mysqld_akonadi,
/usr/bin/mysqlcheck Px -> mysqld_akonadi,
/usr/{,s}bin/mysqld Px -> mysqld_akonadi,
--
2.40.0

View File

@ -1,36 +0,0 @@
From 518c99d1313b621312275a5bd6af919a3d889f26 Mon Sep 17 00:00:00 2001
From: Carl Schwan <carl@carlschwan.eu>
Date: Wed, 26 Apr 2023 19:35:57 +0200
Subject: [PATCH] Avoid crashing before priting debug output when setting up db
Calling debugLastDbError requires the database to be already setup
as it is using the akonadi tracer. So using it to debug why the database
didn't open doesn't work.
CCBUG: 468985
(cherry picked from commit 05db7d03baae46513cd6735ec2c3f28733145b0a)
---
src/server/storage/datastore.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/server/storage/datastore.cpp b/src/server/storage/datastore.cpp
index 8f8a6bc1f..31a29b670 100644
--- a/src/server/storage/datastore.cpp
+++ b/src/server/storage/datastore.cpp
@@ -113,7 +113,10 @@ void DataStore::open()
m_dbOpened = m_database.open();
if (!m_dbOpened) {
- debugLastDbError("Cannot open database.");
+ qCCritical(AKONADISERVER_LOG) << "Database error: Cannot open database.";
+ qCCritical(AKONADISERVER_LOG) << " Last driver error:" << m_database.lastError().driverText();
+ qCCritical(AKONADISERVER_LOG) << " Last database error:" << m_database.lastError().databaseText();
+ return;
} else {
qCDebug(AKONADISERVER_LOG) << "Database" << m_database.databaseName() << "opened using driver" << m_database.driverName();
}
--
2.40.0

View File

@ -1,39 +0,0 @@
From 1d9d64ec3cf78dfdddc2239df0d33b08dc442104 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Daniel=20Vr=C3=A1til?= <dvratil@kde.org>
Date: Sat, 22 Apr 2023 11:43:02 +0200
Subject: [PATCH] Fix crash on server shutdown
When AkonadiServer::quit() is called it clears the vector of existing
connections and destroys them. This can race with a resource disconnecting
or crashing on its own, which then enqueues a singal emission from the
Connection to remove itself from the connections vector as well.
Previously the code assumed the Connection must always exist in the vector
which caused a crash when it did not...surprise surprise.
BUG: 462692
FIXED-IN: 23.04.0
---
src/server/akonadi.cpp | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/server/akonadi.cpp b/src/server/akonadi.cpp
index 7ede9e238..5ff4a9c46 100644
--- a/src/server/akonadi.cpp
+++ b/src/server/akonadi.cpp
@@ -230,8 +230,10 @@ void AkonadiServer::connectionDisconnected()
auto it = std::find_if(mConnections.begin(), mConnections.end(), [this](const auto &ptr) {
return ptr.get() == sender();
});
- Q_ASSERT(it != mConnections.end());
- mConnections.erase(it);
+
+ if (it != mConnections.end()) {
+ mConnections.erase(it);
+ }
}
bool AkonadiServer::setupDatabase()
--
2.40.0

View File

@ -1,53 +0,0 @@
From 0ab418bacdaf8322771e41452a87d062a2449869 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pale=C4=8Dek?= <jpalecek@web.de>
Date: Thu, 20 Apr 2023 16:17:12 +0200
Subject: [PATCH 1/3] Fix wrong for clause in Akonadi::Session
BUG: 468343
BUG: 465245
BUG: 464275
BUG: 462213
BUG: 462169
BUG: 461131
BUG: 460653
BUG: 460586
BUG: 458497
BUG: 458315
(cherry picked from commit eca4fdbdf328883ae564b568c9ba13697cc90c4a)
---
src/core/session.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/core/session.cpp b/src/core/session.cpp
index 227dda367..46106b923 100644
--- a/src/core/session.cpp
+++ b/src/core/session.cpp
@@ -293,7 +293,8 @@ void SessionPrivate::serverStateChanged(ServerManager::State state)
} else if (!connected && state == ServerManager::Broken) {
// If the server is broken, cancel all pending jobs, otherwise they will be
// blocked forever and applications waiting for them to finish would be stuck
- for (Job *job : std::as_const(queue)) {
+ auto q = queue;
+ for (Job *job : q) {
job->setError(Job::ConnectionFailed);
job->kill(KJob::EmitResult);
}
@@ -435,11 +436,13 @@ void Session::clear()
void SessionPrivate::clear(bool forceReconnect)
{
- for (Job *job : std::as_const(queue)) {
+ auto q = queue;
+ for (Job *job : q) {
job->kill(KJob::EmitResult); // safe, not started yet
}
queue.clear();
- for (Job *job : std::as_const(pipeline)) {
+ auto p = pipeline;
+ for (Job *job : p) {
job->d_ptr->mStarted = false; // avoid killing/reconnect loops
job->kill(KJob::EmitResult);
}
--
2.40.0

View File

@ -1,31 +0,0 @@
From d46d05e67c729902e30691fc5f013504c8734ba4 Mon Sep 17 00:00:00 2001
From: Carl Schwan <carl@carlschwan.eu>
Date: Tue, 25 Apr 2023 19:40:09 +0200
Subject: [PATCH] Remove dangling reference
remoteCollection.contentMimeTypes() creates a temporary which is deleted
at the end of the expression. This was a compiler warning.
(cherry picked from commit d9476fd48863a46d4ef5deac4d8a0c7fbdb1c6c5)
---
src/core/collectionsync.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/core/collectionsync.cpp b/src/core/collectionsync.cpp
index 6195b501e..c8817676e 100644
--- a/src/core/collectionsync.cpp
+++ b/src/core/collectionsync.cpp
@@ -376,8 +376,8 @@ public:
return true;
} else {
for (int i = 0, total = remoteCollection.contentMimeTypes().size(); i < total; ++i) {
- const QString &m = remoteCollection.contentMimeTypes().at(i);
- if (!localCollection.contentMimeTypes().contains(m)) {
+ const QString mimetype = remoteCollection.contentMimeTypes().at(i);
+ if (!localCollection.contentMimeTypes().contains(mimetype)) {
return true;
}
}
--
2.40.0

View File

@ -1,34 +0,0 @@
From 70679e219841733000bf5abfc2462872058a4042 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pale=C4=8Dek?= <jpalecek@web.de>
Date: Thu, 20 Apr 2023 16:18:22 +0200
Subject: [PATCH 2/3] Remove dead code from FavoriteCollectionsModel
This code has per search been always dead. On top of that, the for
loop is faulty
(cherry picked from commit 56706add168cdc2a83eda49bfed7714a3ad01cc5)
---
src/core/models/favoritecollectionsmodel.cpp | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/core/models/favoritecollectionsmodel.cpp b/src/core/models/favoritecollectionsmodel.cpp
index 3ba7cec2c..835d8e277 100644
--- a/src/core/models/favoritecollectionsmodel.cpp
+++ b/src/core/models/favoritecollectionsmodel.cpp
@@ -152,13 +152,6 @@ public:
}
}
- void clearReferences()
- {
- for (const Collection::Id &collectionId : std::as_const(referencedCollections)) {
- dereference(collectionId);
- }
- }
-
/**
* Adds a collection to the favorite collections
*/
--
2.40.0

View File

@ -1,30 +0,0 @@
From 046a3e20663f00d75899677656b14c0bc3225526 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pale=C4=8Dek?= <jpalecek@web.de>
Date: Thu, 20 Apr 2023 16:22:14 +0200
Subject: [PATCH 3/3] Fix a bug in for clause in EntityTreeModel
The body of the for loop calls function monitoredCollectionRemoved,
which modifies the list which is iterated over. This can lead to
undefined behavior, so it's better to just iterate over a copy.
(cherry picked from commit b2b2ac0311b735ec80e9b02addae4e00398cf21e)
---
src/core/models/entitytreemodel_p.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/models/entitytreemodel_p.cpp b/src/core/models/entitytreemodel_p.cpp
index ab67c482a..531019562 100644
--- a/src/core/models/entitytreemodel_p.cpp
+++ b/src/core/models/entitytreemodel_p.cpp
@@ -174,7 +174,7 @@ void EntityTreeModelPrivate::agentInstanceRemoved(const Akonadi::AgentInstance &
}
return;
}
- const auto &children = m_childEntities[Collection::root().id()];
+ const auto children = m_childEntities[Collection::root().id()];
for (const Node *node : children) {
Q_ASSERT(node->type == Node::Collection);
--
2.40.0

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e528c3d737c742b2e359345b71f18f65d7973761714716d64b58d35e11094ece
size 1667996

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE2BwMs463Je9mkcOFu0YzUNbvMe8FAmQ473YACgkQu0YzUNbv
Me9jGQ/8D5TqbugHe7EeCdMROykxiG0onxq2a1ZmRKOlUpdocRj3SbApwPCbz74s
vEAoghBbxU99mK/jkxASWpF/U7zwc3S0oR4kGk7k66inxRvPLO0ukgqsRtTtRKGk
JIGQYj3bKijz3LiWbgECra8F4+1X1Qq0CHJCzXo1Z/gUa5Qpuk68ModLIog4xIg8
qV7DeOqUYTcThDlMdttZRiSHoiEIrLLCtqJQ5E801ZL+SKsqMrFMtMlnw986/vsX
9PuWVYeBf2EJZ2J9iW01skUV8tvGawQi1j8yPXYcPD/ZHnA7n3kuZf4NONwRiKJn
ZrZ/y8tsrvJkNCy+oDBJCgAwJP5hCOw0mPMU/7HUleFthETCBsxQNVo2RYn6JnnC
1dOR1nIRZHEZrWlAIu0nKwAXTk0u/OQ+HGu1zag7EzX1Fdrxx2B3u0INhZ/8Xye9
I/q/U/bAQR13crJ4qr40/2dYP55aae2448nU56DCVUYLa1XBvb7ypmhTVf6QI5OD
dyrxGvfPxGFPHbjMMDPZ5jSiFTZCoiLfMD56j7Eu+saAbufw5p5F2ayoFV7I04Vr
mKB3BnbXZXGK3gJgfM8+Ndx3Tcay1Tf1p9llGPwQf+LVdOeEQiRn5Qn3xYUULE0f
aLhK6AM3k41ml9WGOVqHjG7poNHV9Dc9erSyRXjXG+Fiqw+Qtvk=
=bNCh
-----END PGP SIGNATURE-----

3
akonadi-23.04.1.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:386582462d5721587af6657c6cac25a097b3475ac11afc3d3f79a6df6e780e4e
size 1667900

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEE2BwMs463Je9mkcOFu0YzUNbvMe8FAmRZ5PMACgkQu0YzUNbv
Me+cFhAAiOQ+e4Rm0cc0AnQXhNEqqoP4buyiNosd0mwj0gZ5Q9aoSdDsvY6m2IhG
3rqbCBBLfp/gqnMURbBQVGoHTKZ2n/6x57PSStrhCVDRzR5X71PNrrY3YiJCdstn
4vnPNnbfJc02fFkXzYDkhGpYPy0WP323Q+AshgN+Tq9gn6VwhUUnHETXT16/sLDN
GFNtyyBdYA+/Hky/MVZ/pRElrVpbyg0CHgb+Y81e0OyIf/Z55xYBSio1GR9blYIG
HE3uzO1brehGm0c3nkDQxmoxg+nJC0FpvNDCvtC2Vr6OLZaEHFNnLlaS7HLFuNh2
cE2enzdVlBkJ8mvqW0BFQztFVJ4QLWGFIXI4i4ii3iSA9ulM5unPzMePkBOEmtE6
tSVEmZ9zduN6gGV4SDmXDSx9wl0MVVYT84y9+2KDKF2SwdeN1oGFDQsx/VqFWrXf
5OFeozP9HGcCMqs0ijWstmrXTlFtpZIge4CVU73wzIZskotG+AKEWgQBa6CEzZzi
TfpQLj7sfX2/VX3Gh1wSvjIAEyi1QvtJ4qI+tpei9bF3rnwuQsTxlWi0DVfF65xv
YWamwXHjDoX/Q8su78SicqkIPhNLEdjOXf6eGzdMaR7L7Zb/LpGMsvcbhdMuRoe1
VGfJl3h2epS4POYZoxQAc1id+45mraMkn3F35IXrRvCMLcTD4V8=
=w/iN
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,29 @@
-------------------------------------------------------------------
Tue May 9 10:46:19 UTC 2023 - Christophe Marin <christophe@krop.fr>
- Update to 23.04.1
* New bugfix release
* For more details please see:
* https://kde.org/announcements/gear/23.04.1/
- Changes since 23.04.0:
* Allow running mysql_upgrade when starting Akonadi
* Remove dangling reference
* Avoid crashing before priting debug output when setting up db
* Fix crash on server shutdown (kde#462692)
* Use correct INSTALL_TARGETS_DEFAULT_ARGS
* Fix a bug in for clause in EntityTreeModel
* Remove dead code from FavoriteCollectionsModel
* Fix wrong for clause in Akonadi::Session (kde#468343)
* Add a test for faulty iteration in Akonadi::Session
- Drop patches, merged upstream:
* 0001-Fix-wrong-for-clause-in-Akonadi-Session.patch
* 0002-Remove-dead-code-from-FavoriteCollectionsModel.patch
* 0003-Fix-a-bug-in-for-clause-in-EntityTreeModel.patch
* 0001-Fix-crash-on-server-shutdown.patch
* 0001-Avoid-crashing-before-priting-debug-output-when-sett.patch
* 0001-Remove-dangling-reference.patch
* 0001-Allow-running-mysql_upgrade-when-starting-Akonadi.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Apr 28 14:05:49 UTC 2023 - Christophe Marin <christophe@krop.fr> Fri Apr 28 14:05:49 UTC 2023 - Christophe Marin <christophe@krop.fr>

View File

@ -20,7 +20,7 @@
%define kf5_version 5.104.0 %define kf5_version 5.104.0
%bcond_without released %bcond_without released
Name: akonadi-server Name: akonadi-server
Version: 23.04.0 Version: 23.04.1
Release: 0 Release: 0
Summary: PIM Storage Service Summary: PIM Storage Service
License: LGPL-2.1-or-later License: LGPL-2.1-or-later
@ -31,20 +31,6 @@ Source1: https://download.kde.org/stable/release-service/%{version}/src/%
Source2: applications.keyring Source2: applications.keyring
%endif %endif
Source99: akonadi-server-rpmlintrc Source99: akonadi-server-rpmlintrc
# PATCH-FIX-UPSTREAM -- kde#458315 and duplicates
Patch0: 0001-Fix-wrong-for-clause-in-Akonadi-Session.patch
# PATCH-FIX-UPSTREAM
Patch1: 0002-Remove-dead-code-from-FavoriteCollectionsModel.patch
# PATCH-FIX-UPSTREAM -- potential undefined behaviour
Patch2: 0003-Fix-a-bug-in-for-clause-in-EntityTreeModel.patch
# PATCH-FIX-UPSTREAM -- Another crash fix
Patch3: 0001-Fix-crash-on-server-shutdown.patch
# PATCH-FIX-UPSTREAM
Patch4: 0001-Avoid-crashing-before-priting-debug-output-when-sett.patch
# PATCH-FIX-UPSTREAM
Patch5: 0001-Remove-dangling-reference.patch
# PATCH-FIX-UPSTREAM
Patch6: 0001-Allow-running-mysql_upgrade-when-starting-Akonadi.patch
BuildRequires: apparmor-abstractions BuildRequires: apparmor-abstractions
BuildRequires: apparmor-rpm-macros BuildRequires: apparmor-rpm-macros
BuildRequires: extra-cmake-modules >= %{kf5_version} BuildRequires: extra-cmake-modules >= %{kf5_version}