From 2f9992e46eeed1e920e040ce510ff14745cb224b Mon Sep 17 00:00:00 2001 From: Andreas Sturmlechner Date: Sun, 31 Jan 2021 18:03:19 +0100 Subject: kde-misc/kio-fuse: Fix segfault when mounting (at least) baloosearch:/ Upstream commits: 1ee510baa80c834bbcf77a008e5668dbf3eccf4d d69959e226b1b49a1fc2d1a566acd4fdde0f97c3 See also: https://mail.kde.org/pipermail/distributions/2021-January/000927.html KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=431079 Package-Manager: Portage-3.0.14, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner --- .../kio-fuse-5.0.0-fix-segfault-on-links-1.patch | 32 ++++++++++++++ .../kio-fuse-5.0.0-fix-segfault-on-links-2.patch | 49 ++++++++++++++++++++++ kde-misc/kio-fuse/kio-fuse-5.0.0-r1.ebuild | 38 +++++++++++++++++ 3 files changed, 119 insertions(+) create mode 100644 kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-1.patch create mode 100644 kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-2.patch create mode 100644 kde-misc/kio-fuse/kio-fuse-5.0.0-r1.ebuild (limited to 'kde-misc') diff --git a/kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-1.patch b/kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-1.patch new file mode 100644 index 000000000000..7ef61ca22028 --- /dev/null +++ b/kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-1.patch @@ -0,0 +1,32 @@ +From 1ee510baa80c834bbcf77a008e5668dbf3eccf4d Mon Sep 17 00:00:00 2001 +From: Alexander Saoutkin +Date: Sat, 2 Jan 2021 20:01:16 +0000 +Subject: [PATCH] Check return value of createNodeFromUDSEntry() + +createNodeFromUDSEntry() can return a nullptr, which it does when +passed any URL from the baloosearch protocol. + +BUG: 431079 +--- + kiofusevfs.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/kiofusevfs.cpp b/kiofusevfs.cpp +index 6f275cb..fbf6e27 100644 +--- a/kiofusevfs.cpp ++++ b/kiofusevfs.cpp +@@ -393,6 +393,11 @@ void KIOFuseVFS::findAndCreateOrigin(QUrl url, QStringList pathElements, std::fu + if(!finalNode) + { + finalNode = createNodeFromUDSEntry(statJob->statResult(), currentNode->m_stat.st_ino, targetPathComponents.last()); ++ if(!finalNode) ++ { ++ qWarning(KIOFUSE_LOG) << "Unable to create a valid final node for" << url << "from its UDS Entry"; ++ return callback({}, EIO); ++ } + insertNode(finalNode); + } + +-- +GitLab + diff --git a/kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-2.patch b/kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-2.patch new file mode 100644 index 000000000000..a16da6d75357 --- /dev/null +++ b/kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-2.patch @@ -0,0 +1,49 @@ +From d69959e226b1b49a1fc2d1a566acd4fdde0f97c3 Mon Sep 17 00:00:00 2001 +From: Fabian Vogt +Date: Thu, 7 Jan 2021 22:46:19 +0100 +Subject: [PATCH] UDS_URL is not meant for links, Use UDS_TARGET_URL instead + +The KIO documentation for UDS_URL says: +`use UDS_TARGET_URL if you want "links" to unrelated urls.` +So the use of UDS_URL here was probably wrong. +Switching to UDS_TARGET_URL fixes mounting of some slaves such as baloosearch, +which set UDS_URL to the URL of the entry itself for some reason. + +BUG: 431079 +--- + kiofusevfs.cpp | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/kiofusevfs.cpp b/kiofusevfs.cpp +index fbf6e27..5c775b7 100644 +--- a/kiofusevfs.cpp ++++ b/kiofusevfs.cpp +@@ -1736,12 +1736,12 @@ std::shared_ptr KIOFuseVFS::createNodeFromUDSEntry(const KIO::UDSEn + attr.st_gid = gr->gr_gid; + } + +- if(entry.contains(KIO::UDSEntry::UDS_LOCAL_PATH) || entry.contains(KIO::UDSEntry::UDS_URL)) ++ if(entry.contains(KIO::UDSEntry::UDS_LOCAL_PATH) || entry.contains(KIO::UDSEntry::UDS_TARGET_URL)) + { + // Create as symlink if possible + QString target = entry.stringValue(KIO::UDSEntry::UDS_LOCAL_PATH); + if(target.isEmpty()) +- target = QUrl(entry.stringValue(KIO::UDSEntry::UDS_URL)).toLocalFile(); ++ target = QUrl(entry.stringValue(KIO::UDSEntry::UDS_TARGET_URL)).toLocalFile(); + + if(!target.isEmpty()) + { +@@ -1760,7 +1760,9 @@ std::shared_ptr KIOFuseVFS::createNodeFromUDSEntry(const KIO::UDSEn + { + attr.st_mode |= S_IFREG; + std::shared_ptr ret = nullptr; +- const QUrl nodeUrl = QUrl{entry.stringValue(KIO::UDSEntry::UDS_URL)}; ++ const QUrl nodeUrl = QUrl{entry.stringValue(KIO::UDSEntry::UDS_TARGET_URL)}; ++ if(nodeUrl.isEmpty()) ++ return nullptr; + if(m_useFileJob && KProtocolManager::supportsOpening(nodeUrl) && KProtocolManager::supportsTruncating(nodeUrl)) + ret = std::make_shared(parentIno, name, attr); + else +-- +GitLab + diff --git a/kde-misc/kio-fuse/kio-fuse-5.0.0-r1.ebuild b/kde-misc/kio-fuse/kio-fuse-5.0.0-r1.ebuild new file mode 100644 index 000000000000..640b89cb23b8 --- /dev/null +++ b/kde-misc/kio-fuse/kio-fuse-5.0.0-r1.ebuild @@ -0,0 +1,38 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +ECM_TEST="true" +KFMIN=5.74.0 +QTMIN=5.15.1 +inherit ecm kde.org + +DESCRIPTION="FUSE interface for KIO" +HOMEPAGE="https://feverfew.home.blog/2019/12/24/kiofuse-beta-4-9-0-released/" + +if [[ ${KDE_BUILD_TYPE} = release ]]; then + SRC_URI="mirror://kde/stable/${PN}/${PV}/${P}.tar.xz" + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" +fi + +LICENSE="GPL-3+" +SLOT="5" +IUSE="" + +RESTRICT+=" test" # depend on fuse kernel module + +DEPEND=" + >=dev-qt/qtdbus-${QTMIN}:5 + >=dev-qt/qtgui-${QTMIN}:5 + >=dev-qt/qtwidgets-${QTMIN}:5 + >=kde-frameworks/kcoreaddons-${KFMIN}:5 + >=kde-frameworks/ki18n-${KFMIN}:5 + >=kde-frameworks/kio-${KFMIN}:5 + sys-fs/fuse:3 +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}"/${P}-fix-segfault-on-links-{1,2}.patch # KDE-Bug 431079 +) -- cgit v1.2.3-65-gdbad