commit:     5a15b9b4cdb4ace6be8597189bab3859bbfacc69
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon May 29 22:57:36 2017 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon May 29 22:58:34 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a15b9b4

kde-frameworks/kio: Fix kioclient5 exec with PIE binaries

See also: https://bugs.kde.org/show_bug.cgi?id=350018

Package-Manager: Portage-2.3.5, Repoman-2.3.1

 kde-frameworks/kio/files/kio-5.34.0-pie.patch | 62 ++++++++++++++++++++
 kde-frameworks/kio/kio-5.34.0-r2.ebuild       | 84 +++++++++++++++++++++++++++
 2 files changed, 146 insertions(+)

diff --git a/kde-frameworks/kio/files/kio-5.34.0-pie.patch 
b/kde-frameworks/kio/files/kio-5.34.0-pie.patch
new file mode 100644
index 00000000000..973f9550447
--- /dev/null
+++ b/kde-frameworks/kio/files/kio-5.34.0-pie.patch
@@ -0,0 +1,62 @@
+commit 4122b52fee540f6b7cdd8fde2f55e2f7c2673b1a
+Author: Fabian Vogt <[email protected]>
+Date:   Sun May 28 14:49:03 2017 +0200
+
+    Identify PIE binaries (application/x-sharedlib) as executable files
+    
+    Summary:
+    x86_64 binaries compiled with PIE are just shared objects with the
+    executable bit set. Without this patch, kio does not know that they
+    can be executed as well, causing "kioclient5 exec" to ask for an
+    application that can handle application/x-sharedlib.
+    
+    BUG: 350018
+    
+    Test Plan: Can run applications fine again.
+    
+    Reviewers: dfaure, aacid
+    
+    Reviewed By: dfaure
+    
+    Subscribers: asturmlechner, #frameworks
+    
+    Tags: #frameworks
+    
+    Differential Revision: https://phabricator.kde.org/D6002
+
+diff --git a/src/widgets/krun.cpp b/src/widgets/krun.cpp
+index 399ca975..2a9b563a 100644
+--- a/src/widgets/krun.cpp
++++ b/src/widgets/krun.cpp
+@@ -139,7 +139,8 @@ bool KRun::isExecutableFile(const QUrl &url, const QString 
&mimetype)
+ #ifdef Q_OS_WIN
+                 
mimeType.inherits(QLatin1String("application/x-ms-dos-executable")) ||
+ #endif
+-                
mimeType.inherits(QStringLiteral("application/x-executable-script"))
++                
mimeType.inherits(QStringLiteral("application/x-executable-script")) ||
++                mimeType.inherits(QStringLiteral("application/x-sharedlib"))
+            ) {
+             return true;
+         }
+@@ -1438,6 +1439,8 @@ bool KRun::isExecutable(const QString &serviceType)
+ {
+     return (serviceType == QLatin1String("application/x-desktop") ||
+             serviceType == QLatin1String("application/x-executable") ||
++            /* See https://bugs.freedesktop.org/show_bug.cgi?id=97226 */
++            serviceType == QLatin1String("application/x-sharedlib") ||
+             serviceType == QLatin1String("application/x-ms-dos-executable") ||
+             serviceType == QLatin1String("application/x-shellscript"));
+ }
+diff --git a/src/widgets/krun.h b/src/widgets/krun.h
+index 2d167fc8..1012fb2b 100644
+--- a/src/widgets/krun.h
++++ b/src/widgets/krun.h
+@@ -436,7 +436,7 @@ public:
+      * To be executable the file must pass the following rules:
+      * -# Must reside on the local filesystem.
+      * -# Must be marked as executable for the user by the filesystem.
+-     * -# The mime type must inherit application/x-executable or 
application/x-executable-script.
++     * -# The mime type must inherit application/x-executable, 
application/x-executable-script or application/x-sharedlib.
+      * To allow a script to run when the above rules are satisfied add the 
entry
+      * @code
+      * X-KDE-IsAlso=application/x-executable-script

diff --git a/kde-frameworks/kio/kio-5.34.0-r2.ebuild 
b/kde-frameworks/kio/kio-5.34.0-r2.ebuild
new file mode 100644
index 00000000000..3fa22fb33b0
--- /dev/null
+++ b/kde-frameworks/kio/kio-5.34.0-r2.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+KDE_TEST="forceoptional-recursive"
+VIRTUALX_REQUIRED="test"
+inherit kde5
+
+DESCRIPTION="Framework providing transparent file and data management"
+LICENSE="LGPL-2+"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="acl +handbook kerberos +kwallet X"
+
+COMMON_DEPEND="
+       $(add_frameworks_dep karchive)
+       $(add_frameworks_dep kbookmarks)
+       $(add_frameworks_dep kcodecs)
+       $(add_frameworks_dep kcompletion)
+       $(add_frameworks_dep kconfig)
+       $(add_frameworks_dep kconfigwidgets)
+       $(add_frameworks_dep kcoreaddons)
+       $(add_frameworks_dep kdbusaddons)
+       $(add_frameworks_dep ki18n)
+       $(add_frameworks_dep kiconthemes)
+       $(add_frameworks_dep kitemviews)
+       $(add_frameworks_dep kjobwidgets)
+       $(add_frameworks_dep knotifications)
+       $(add_frameworks_dep kservice)
+       $(add_frameworks_dep ktextwidgets)
+       $(add_frameworks_dep kwidgetsaddons)
+       $(add_frameworks_dep kwindowsystem)
+       $(add_frameworks_dep kxmlgui)
+       $(add_frameworks_dep solid)
+       $(add_qt_dep qtdbus)
+       $(add_qt_dep qtgui)
+       $(add_qt_dep qtnetwork 'ssl')
+       $(add_qt_dep qtscript)
+       $(add_qt_dep qtwidgets)
+       $(add_qt_dep qtxml)
+       dev-libs/libxml2
+       dev-libs/libxslt
+       acl? (
+               sys-apps/attr
+               virtual/acl
+       )
+       kerberos? ( virtual/krb5 )
+       kwallet? ( $(add_frameworks_dep kwallet) )
+       X? ( $(add_qt_dep qtx11extras) )
+"
+DEPEND="${COMMON_DEPEND}
+       $(add_qt_dep qtconcurrent)
+       handbook? ( $(add_frameworks_dep kdoctools) )
+       test? ( sys-libs/zlib )
+       X? (
+               x11-libs/libX11
+               x11-libs/libXrender
+               x11-proto/xproto
+       )
+"
+PDEPEND="
+       $(add_frameworks_dep kded)
+"
+RDEPEND="${COMMON_DEPEND}"
+
+# tests hang
+RESTRICT+=" test"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-previewjob{1,2}.patch
+       "${FILESDIR}"/${P}-kio.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               $(cmake-utils_use_find_package acl ACL)
+               $(cmake-utils_use_find_package handbook KF5DocTools)
+               $(cmake-utils_use_find_package kerberos GSSAPI)
+               $(cmake-utils_use_find_package kwallet KF5Wallet)
+               $(cmake-utils_use_find_package X X11)
+       )
+
+       kde5_src_configure
+}

Reply via email to