Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: kde-misc/kio-fuse/files/, kde-misc/kio-fuse/
Date: Sun, 31 Jan 2021 17:13:42
Message-Id: 1612113158.2f9992e46eeed1e920e040ce510ff14745cb224b.asturm@gentoo
1 commit: 2f9992e46eeed1e920e040ce510ff14745cb224b
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 31 17:03:19 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 31 17:12:38 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f9992e4
7
8 kde-misc/kio-fuse: Fix segfault when mounting (at least) baloosearch:/
9
10 Upstream commits:
11 1ee510baa80c834bbcf77a008e5668dbf3eccf4d
12 d69959e226b1b49a1fc2d1a566acd4fdde0f97c3
13
14 See also: https://mail.kde.org/pipermail/distributions/2021-January/000927.html
15
16 KDE-Bug: https://bugs.kde.org/show_bug.cgi?id=431079
17 Package-Manager: Portage-3.0.14, Repoman-3.0.2
18 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
19
20 .../kio-fuse-5.0.0-fix-segfault-on-links-1.patch | 32 ++++++++++++++
21 .../kio-fuse-5.0.0-fix-segfault-on-links-2.patch | 49 ++++++++++++++++++++++
22 kde-misc/kio-fuse/kio-fuse-5.0.0-r1.ebuild | 38 +++++++++++++++++
23 3 files changed, 119 insertions(+)
24
25 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
26 new file mode 100644
27 index 00000000000..7ef61ca2202
28 --- /dev/null
29 +++ b/kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-1.patch
30 @@ -0,0 +1,32 @@
31 +From 1ee510baa80c834bbcf77a008e5668dbf3eccf4d Mon Sep 17 00:00:00 2001
32 +From: Alexander Saoutkin <a.saoutkin@×××××.com>
33 +Date: Sat, 2 Jan 2021 20:01:16 +0000
34 +Subject: [PATCH] Check return value of createNodeFromUDSEntry()
35 +
36 +createNodeFromUDSEntry() can return a nullptr, which it does when
37 +passed any URL from the baloosearch protocol.
38 +
39 +BUG: 431079
40 +---
41 + kiofusevfs.cpp | 5 +++++
42 + 1 file changed, 5 insertions(+)
43 +
44 +diff --git a/kiofusevfs.cpp b/kiofusevfs.cpp
45 +index 6f275cb..fbf6e27 100644
46 +--- a/kiofusevfs.cpp
47 ++++ b/kiofusevfs.cpp
48 +@@ -393,6 +393,11 @@ void KIOFuseVFS::findAndCreateOrigin(QUrl url, QStringList pathElements, std::fu
49 + if(!finalNode)
50 + {
51 + finalNode = createNodeFromUDSEntry(statJob->statResult(), currentNode->m_stat.st_ino, targetPathComponents.last());
52 ++ if(!finalNode)
53 ++ {
54 ++ qWarning(KIOFUSE_LOG) << "Unable to create a valid final node for" << url << "from its UDS Entry";
55 ++ return callback({}, EIO);
56 ++ }
57 + insertNode(finalNode);
58 + }
59 +
60 +--
61 +GitLab
62 +
63
64 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
65 new file mode 100644
66 index 00000000000..a16da6d7535
67 --- /dev/null
68 +++ b/kde-misc/kio-fuse/files/kio-fuse-5.0.0-fix-segfault-on-links-2.patch
69 @@ -0,0 +1,49 @@
70 +From d69959e226b1b49a1fc2d1a566acd4fdde0f97c3 Mon Sep 17 00:00:00 2001
71 +From: Fabian Vogt <fabian@×××××××××××.de>
72 +Date: Thu, 7 Jan 2021 22:46:19 +0100
73 +Subject: [PATCH] UDS_URL is not meant for links, Use UDS_TARGET_URL instead
74 +
75 +The KIO documentation for UDS_URL says:
76 +`use UDS_TARGET_URL if you want "links" to unrelated urls.`
77 +So the use of UDS_URL here was probably wrong.
78 +Switching to UDS_TARGET_URL fixes mounting of some slaves such as baloosearch,
79 +which set UDS_URL to the URL of the entry itself for some reason.
80 +
81 +BUG: 431079
82 +---
83 + kiofusevfs.cpp | 8 +++++---
84 + 1 file changed, 5 insertions(+), 3 deletions(-)
85 +
86 +diff --git a/kiofusevfs.cpp b/kiofusevfs.cpp
87 +index fbf6e27..5c775b7 100644
88 +--- a/kiofusevfs.cpp
89 ++++ b/kiofusevfs.cpp
90 +@@ -1736,12 +1736,12 @@ std::shared_ptr<KIOFuseNode> KIOFuseVFS::createNodeFromUDSEntry(const KIO::UDSEn
91 + attr.st_gid = gr->gr_gid;
92 + }
93 +
94 +- if(entry.contains(KIO::UDSEntry::UDS_LOCAL_PATH) || entry.contains(KIO::UDSEntry::UDS_URL))
95 ++ if(entry.contains(KIO::UDSEntry::UDS_LOCAL_PATH) || entry.contains(KIO::UDSEntry::UDS_TARGET_URL))
96 + {
97 + // Create as symlink if possible
98 + QString target = entry.stringValue(KIO::UDSEntry::UDS_LOCAL_PATH);
99 + if(target.isEmpty())
100 +- target = QUrl(entry.stringValue(KIO::UDSEntry::UDS_URL)).toLocalFile();
101 ++ target = QUrl(entry.stringValue(KIO::UDSEntry::UDS_TARGET_URL)).toLocalFile();
102 +
103 + if(!target.isEmpty())
104 + {
105 +@@ -1760,7 +1760,9 @@ std::shared_ptr<KIOFuseNode> KIOFuseVFS::createNodeFromUDSEntry(const KIO::UDSEn
106 + {
107 + attr.st_mode |= S_IFREG;
108 + std::shared_ptr<KIOFuseRemoteFileNode> ret = nullptr;
109 +- const QUrl nodeUrl = QUrl{entry.stringValue(KIO::UDSEntry::UDS_URL)};
110 ++ const QUrl nodeUrl = QUrl{entry.stringValue(KIO::UDSEntry::UDS_TARGET_URL)};
111 ++ if(nodeUrl.isEmpty())
112 ++ return nullptr;
113 + if(m_useFileJob && KProtocolManager::supportsOpening(nodeUrl) && KProtocolManager::supportsTruncating(nodeUrl))
114 + ret = std::make_shared<KIOFuseRemoteFileJobBasedFileNode>(parentIno, name, attr);
115 + else
116 +--
117 +GitLab
118 +
119
120 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
121 new file mode 100644
122 index 00000000000..640b89cb23b
123 --- /dev/null
124 +++ b/kde-misc/kio-fuse/kio-fuse-5.0.0-r1.ebuild
125 @@ -0,0 +1,38 @@
126 +# Copyright 1999-2021 Gentoo Authors
127 +# Distributed under the terms of the GNU General Public License v2
128 +
129 +EAPI=7
130 +
131 +ECM_TEST="true"
132 +KFMIN=5.74.0
133 +QTMIN=5.15.1
134 +inherit ecm kde.org
135 +
136 +DESCRIPTION="FUSE interface for KIO"
137 +HOMEPAGE="https://feverfew.home.blog/2019/12/24/kiofuse-beta-4-9-0-released/"
138 +
139 +if [[ ${KDE_BUILD_TYPE} = release ]]; then
140 + SRC_URI="mirror://kde/stable/${PN}/${PV}/${P}.tar.xz"
141 + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
142 +fi
143 +
144 +LICENSE="GPL-3+"
145 +SLOT="5"
146 +IUSE=""
147 +
148 +RESTRICT+=" test" # depend on fuse kernel module
149 +
150 +DEPEND="
151 + >=dev-qt/qtdbus-${QTMIN}:5
152 + >=dev-qt/qtgui-${QTMIN}:5
153 + >=dev-qt/qtwidgets-${QTMIN}:5
154 + >=kde-frameworks/kcoreaddons-${KFMIN}:5
155 + >=kde-frameworks/ki18n-${KFMIN}:5
156 + >=kde-frameworks/kio-${KFMIN}:5
157 + sys-fs/fuse:3
158 +"
159 +RDEPEND="${DEPEND}"
160 +
161 +PATCHES=(
162 + "${FILESDIR}"/${P}-fix-segfault-on-links-{1,2}.patch # KDE-Bug 431079
163 +)