summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2023-03-23 12:08:45 +0100
committerAndreas Sturmlechner <asturm@gentoo.org>2023-03-23 15:46:51 +0100
commitc986087a4afcd9106262bf3df9a8b82abe76aadf (patch)
tree6f11903353f7d983a85191740d98aa839ae0ac56
parentkde-apps/libgravatar: Broken test was renamed (diff)
downloadgentoo-c986087a4afcd9106262bf3df9a8b82abe76aadf.tar.gz
gentoo-c986087a4afcd9106262bf3df9a8b82abe76aadf.tar.bz2
gentoo-c986087a4afcd9106262bf3df9a8b82abe76aadf.zip
kde-frameworks/kcoreaddons: Prevent KSignalHandler leaking signalfd
Bug: https://bugs.gentoo.org/899706 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
-rw-r--r--kde-frameworks/kcoreaddons/files/kcoreaddons-5.104.0-prevent-leak-signalfd-fds.patch29
-rw-r--r--kde-frameworks/kcoreaddons/kcoreaddons-5.104.0-r1.ebuild56
2 files changed, 85 insertions, 0 deletions
diff --git a/kde-frameworks/kcoreaddons/files/kcoreaddons-5.104.0-prevent-leak-signalfd-fds.patch b/kde-frameworks/kcoreaddons/files/kcoreaddons-5.104.0-prevent-leak-signalfd-fds.patch
new file mode 100644
index 000000000000..b5f1c4d0e0da
--- /dev/null
+++ b/kde-frameworks/kcoreaddons/files/kcoreaddons-5.104.0-prevent-leak-signalfd-fds.patch
@@ -0,0 +1,29 @@
+From 3e0d5fe16650b48b6002a167bb822b48596bc129 Mon Sep 17 00:00:00 2001
+From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
+Date: Wed, 8 Mar 2023 15:45:36 +0000
+Subject: [PATCH] Prevent KSignalHandler leaking signalfd file descriptors
+
+We need SOCK_CLOEXEC otherwise the file descriptors will be leaked to
+the child processes.
+
+(cherry picked from commit 6a3cf7fe658da22e2c98af681204666b27fc8d56)
+---
+ src/lib/util/ksignalhandler.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/lib/util/ksignalhandler.cpp b/src/lib/util/ksignalhandler.cpp
+index a051088c..1a644805 100644
+--- a/src/lib/util/ksignalhandler.cpp
++++ b/src/lib/util/ksignalhandler.cpp
+@@ -34,7 +34,7 @@ KSignalHandler::KSignalHandler()
+ {
+ d->q = this;
+ #ifndef Q_OS_WIN
+- if (::socketpair(AF_UNIX, SOCK_STREAM, 0, KSignalHandlerPrivate::signalFd)) {
++ if (::socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, KSignalHandlerPrivate::signalFd)) {
+ qCWarning(KCOREADDONS_DEBUG) << "Couldn't create a socketpair";
+ return;
+ }
+--
+2.40.0
+
diff --git a/kde-frameworks/kcoreaddons/kcoreaddons-5.104.0-r1.ebuild b/kde-frameworks/kcoreaddons/kcoreaddons-5.104.0-r1.ebuild
new file mode 100644
index 000000000000..8530e533f2cd
--- /dev/null
+++ b/kde-frameworks/kcoreaddons/kcoreaddons-5.104.0-r1.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+QTMIN=5.15.5
+inherit ecm frameworks.kde.org xdg-utils
+
+DESCRIPTION="Framework for solving common problems such as caching, randomisation, and more"
+
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="dbus fam"
+
+DEPEND="
+ >=dev-qt/qtcore-${QTMIN}:5[icu]
+ virtual/libudev:=
+ dbus? ( >=dev-qt/qtdbus-${QTMIN}:5 )
+ fam? ( virtual/fam )
+"
+RDEPEND="${DEPEND}
+ >=dev-qt/qttranslations-${QTMIN}:5
+"
+BDEPEND=">=dev-qt/linguist-tools-${QTMIN}:5"
+
+PATCHES=( "${FILESDIR}/${P}-prevent-leak-signalfd-fds.patch" )
+
+src_configure() {
+ local mycmakeargs=(
+ -D_KDE4_DEFAULT_HOME_POSTFIX=4
+ $(cmake_use_find_package fam FAM)
+ $(cmake_use_find_package dbus Qt5DBus)
+ )
+
+ ecm_src_configure
+}
+
+src_test() {
+ # bugs: 619656, 632398, 647414, 665682
+ local myctestargs=(
+ -j1
+ -E "(kautosavefiletest|kdirwatch_qfswatch_unittest|kdirwatch_stat_unittest|kformattest)"
+ )
+
+ ecm_src_test
+}
+
+pkg_postinst() {
+ ecm_pkg_postinst
+ xdg_mimeinfo_database_update
+}
+
+pkg_postrm() {
+ ecm_pkg_postrm
+ xdg_mimeinfo_database_update
+}