summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-12-07 20:09:21 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2020-12-07 20:10:20 +0100
commit720d0a58fc320b085432bede30138d1ef2d12504 (patch)
treece36dd0bb66382dc9d07054506e3398f36d056f0 /mail-client
parentdev-vcs/svneverever: Drop old (diff)
downloadgentoo-720d0a58fc320b085432bede30138d1ef2d12504.tar.gz
gentoo-720d0a58fc320b085432bede30138d1ef2d12504.tar.bz2
gentoo-720d0a58fc320b085432bede30138d1ef2d12504.zip
mail-client/trojita: Fix crash when opening attachments
That's patch no.11 and definitely the last one. Package-Manager: Portage-3.0.12, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'mail-client')
-rw-r--r--mail-client/trojita/files/trojita-0.7-crash-w-attachments.patch68
-rw-r--r--mail-client/trojita/trojita-0.7-r6.ebuild90
2 files changed, 158 insertions, 0 deletions
diff --git a/mail-client/trojita/files/trojita-0.7-crash-w-attachments.patch b/mail-client/trojita/files/trojita-0.7-crash-w-attachments.patch
new file mode 100644
index 000000000000..38d11316e5ef
--- /dev/null
+++ b/mail-client/trojita/files/trojita-0.7-crash-w-attachments.patch
@@ -0,0 +1,68 @@
+From cf2364b80fa8ae844df8350cd5833d47cce235f2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jan=20Kundr=C3=A1t?= <jkt@kde.org>
+Date: Mon, 9 Mar 2020 08:24:48 -0700
+Subject: [PATCH] Fix possible crash when downloading attachments
+
+Turns out we've been happily deleting network replies from the
+QNetworkReply::finished(). That was never a good thing to do, but it did
+not use to crash with older Qt. Now it does.
+
+After changing to deleteLater(), there's a window for
+already-deregistered replies to generate events, therefore the assert
+has to go, too, otherwise Bad Things happen:
+
+ (gdb) bt
+ #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
+ #1 0x00007ffff16bdcd2 in __GI_abort () at abort.c:89
+ #2 0x00007ffff2400bcb in qt_message_fatal (context=..., message=<synthetic pointer>...) at /var/tmp/portage/dev-qt/qtcore-5.13.9999/work/qtcore-5.13.9999/src/corelib/global/qlogging.cpp:1904
+ #3 QMessageLogger::fatal (this=this@entry=0x7fffffffc990, msg=msg@entry=0x7ffff2690b10 "ASSERT: \"%s\" in file %s, line %d") at /var/tmp/portage/dev-qt/qtcore-5.13.9999/work/qtcore-5.13.9999/src/corelib/global/qlogging.cpp:888
+ #4 0x00007ffff23fff7c in qt_assert (assertion=assertion@entry=0x5555558451d7 "reply", file=file@entry=0x555555841a38 "/home/jkt/work/prog/trojita/src/Imap/Network/FileDownloadManager.cpp", line=line@entry=142)
+ at /var/tmp/portage/dev-qt/qtcore-5.13.9999/work/qtcore-5.13.9999/src/corelib/global/qglobal.cpp:3247
+ #5 0x00005555555da840 in Imap::Network::FileDownloadManager::onPartDataTransfered (this=0x555556a20990)
+ #6 0x00007ffff25f1bdf in QtPrivate::QSlotObjectBase::call (a=0x7fffffffcaa0, r=0x555556a20990, this=0x5555569f99c0) at ../../include/QtCore/../../../qtcore-5.13.9999/src/corelib/kernel/qobjectdefs_impl.h:394
+ #7 QMetaObject::activate(QObject*, int, int, void**) () at /var/tmp/portage/dev-qt/qtcore-5.13.9999/work/qtcore-5.13.9999/src/corelib/kernel/qobject.cpp:3787
+ #8 0x00007ffff25f20b7 in QMetaObject::activate (sender=sender@entry=0x555556a21370, m=m@entry=0x7ffff3f96b00 <QNetworkReply::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x0)
+ at /var/tmp/portage/dev-qt/qtcore-5.13.9999/work/qtcore-5.13.9999/src/corelib/kernel/qobject.cpp:3658
+ #9 0x00007ffff3d3cbf3 in QNetworkReply::finished (this=this@entry=0x555556a21370) at .moc/moc_qnetworkreply.cpp:385
+ #10 0x0000555555709485 in Imap::Network::MsgPartNetworkReply::slotMyDataChanged() () at /home/jkt/work/prog/trojita/src/Imap/Network/MsgPartNetworkReply.cpp:112
+
+BUG: 417697
+Reported-by: Stefan de Konink <stefan@konink.de>
+Change-Id: I79f340c5a471430a14474472513d0a055c7238d6
+---
+ src/Imap/Network/FileDownloadManager.cpp | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/src/Imap/Network/FileDownloadManager.cpp b/src/Imap/Network/FileDownloadManager.cpp
+index 16b6c8df..c3f72176 100644
+--- a/src/Imap/Network/FileDownloadManager.cpp
++++ b/src/Imap/Network/FileDownloadManager.cpp
+@@ -139,7 +139,9 @@ void FileDownloadManager::downloadMessage()
+
+ void FileDownloadManager::onPartDataTransfered()
+ {
+- Q_ASSERT(reply);
++ if (!reply) {
++ return;
++ }
+ if (reply->error() == QNetworkReply::NoError) {
+ if (!saving.open(QIODevice::WriteOnly)) {
+ emit transferError(saving.errorString());
+@@ -192,11 +194,11 @@ void FileDownloadManager::onCombinerTransferError(const QString &message)
+
+ void FileDownloadManager::deleteReply(QNetworkReply *reply)
+ {
+- if (reply == this->reply) {
++ if (reply && reply == this->reply) {
+ if (!saved)
+ onPartDataTransfered();
+- delete reply;
+- this->reply = 0;
++ reply->deleteLater();
++ this->reply = nullptr;
+ }
+ }
+
+--
+GitLab
+
diff --git a/mail-client/trojita/trojita-0.7-r6.ebuild b/mail-client/trojita/trojita-0.7-r6.ebuild
new file mode 100644
index 000000000000..7c1b4c0b6fac
--- /dev/null
+++ b/mail-client/trojita/trojita-0.7-r6.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+if [[ ${PV} = *9999* ]]; then
+ EGIT_REPO_URI="https://anongit.kde.org/${PN}.git"
+ inherit git-r3
+else
+ SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz"
+ KEYWORDS="amd64 x86"
+fi
+inherit cmake virtualx xdg
+
+DESCRIPTION="A Qt IMAP e-mail client"
+HOMEPAGE="http://trojita.flaska.net/"
+
+LICENSE="|| ( GPL-2 GPL-3 )"
+SLOT="0"
+IUSE="+crypt +dbus debug +password test +zlib"
+
+REQUIRED_USE="password? ( dbus )"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ dev-qt/linguist-tools:5
+ zlib? ( virtual/pkgconfig )
+"
+RDEPEND="
+ dev-qt/qtcore:5
+ dev-qt/qtgui:5
+ dev-qt/qtnetwork:5[ssl]
+ dev-qt/qtsql:5[sqlite]
+ dev-qt/qtsvg:5
+ dev-qt/qtwebkit:5
+ dev-qt/qtwidgets:5
+ crypt? (
+ >=app-crypt/gpgme-1.8.0[cxx,qt5]
+ dev-libs/mimetic
+ )
+ dbus? ( dev-qt/qtdbus:5 )
+ password? ( dev-libs/qtkeychain[qt5(+)] )
+ zlib? ( sys-libs/zlib )
+"
+DEPEND="${RDEPEND}
+ test? ( dev-qt/qttest:5 )
+"
+
+DOCS=( README LICENSE )
+
+PATCHES=(
+ "${FILESDIR}/${P}-gpgme.patch"
+ "${FILESDIR}/${P}-gpg-tests.patch"
+ "${FILESDIR}/${P}-qt-5.11b3.patch"
+ "${FILESDIR}/${P}-qt-5.13.patch" # bug 730058
+ "${FILESDIR}/${P}-qt-5.15.patch"
+ "${FILESDIR}/${P}-CVE-2019-10734.patch" # KDE-bug 404697
+ "${FILESDIR}/${P}-CVE-2020-15047.patch" # bug 729596
+ "${FILESDIR}/${P}-cmake-cxx11.patch"
+ "${FILESDIR}/${P}-desktop-spec-namespace.patch"
+ "${FILESDIR}/${P}-metainfo.patch" # bug 730140
+ "${FILESDIR}/${P}-crash-w-attachments.patch" # KDE-Bug 417697
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ # the build system is taking a look at `git describe ... --dirty` and
+ # gentoo's modifications to CMakeLists.txt break these
+ sed -e "s/--dirty//" -i cmake/TrojitaVersion.cmake || die "Cannot fix the version check"
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DWITH_RAGEL=OFF # bug 739866, broken by ragel-7
+ -DWITH_CRYPTO_MESSAGES=$(usex crypt)
+ -DWITH_GPGMEPP=$(usex crypt)
+ -DWITH_MIMETIC=$(usex crypt)
+ -DWITH_DBUS=$(usex dbus)
+ -DWITH_QTKEYCHAIN_PLUGIN=$(usex password)
+ -DWITH_TESTS=$(usex test)
+ -DWITH_ZLIB=$(usex zlib)
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ virtx cmake_src_test
+}