x11-apps/radeon-profile-daemon: Adjusted live ebuild
authorLars Wendler <polynomial-c@gentoo.org>
Thu, 13 Jun 2019 14:06:14 +0000 (16:06 +0200)
committerLars Wendler <polynomial-c@gentoo.org>
Thu, 13 Jun 2019 14:27:27 +0000 (16:27 +0200)
Package-Manager: Portage-2.3.67, Repoman-2.3.14
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
x11-apps/radeon-profile-daemon/files/radeon-profile-daemon-20190603-secure_socket.patch [new file with mode: 0644]
x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd-r1 [new file with mode: 0644]
x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild

diff --git a/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon-20190603-secure_socket.patch b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon-20190603-secure_socket.patch
new file mode 100644 (file)
index 0000000..951e7d1
--- /dev/null
@@ -0,0 +1,26 @@
+From 47ddfbb7b85c3e99eb0d132078c989c0dfa2ea9b Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Thu, 13 Jun 2019 15:58:44 +0200
+Subject: [PATCH] Don't make the socket world writable
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ radeon-profile-daemon/rpdthread.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/radeon-profile-daemon/rpdthread.cpp b/radeon-profile-daemon/rpdthread.cpp
+index 8785efa..94a0d6f 100644
+--- a/radeon-profile-daemon/rpdthread.cpp
++++ b/radeon-profile-daemon/rpdthread.cpp
+@@ -47,7 +47,7 @@ void rpdThread::createServer()
+     QLocalServer::removeServer(serverSocketPath);
+     daemonServer.listen(serverSocketPath);
+-    QFile::setPermissions(serverSocketPath, QFile(serverSocketPath).permissions() | QFile::WriteOther | QFile::ReadOther);
++    QFile::setPermissions(serverSocketPath, QFile(serverSocketPath).permissions() | QFile::WriteGroup | QFile::ReadGroup);
+ }
+ void rpdThread::closeConnection()
+-- 
+2.22.0
+
diff --git a/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd-r1 b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd-r1
new file mode 100644 (file)
index 0000000..813ab95
--- /dev/null
@@ -0,0 +1,19 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Daemon for radeon-profile GUI"
+
+command="/usr/sbin/radeon-profile-daemon"
+command_background="true"
+pidfile="/run/${SVCNAME}.pid"
+
+radeon_socket="/run/radeon-profile-daemon-server"
+
+start_post() {
+       if ewaitfile 10 ${radeon_socket} ; then
+               chgrp video ${radeon_socket}
+       else
+               eerror "Failed to find socket file ${radeon_socket}"
+       fi
+}
index 924760fc909964368641ee778db7311c778447b0..77f7239752b9c1766ac5e8702e3932e8ee5d8df0 100644 (file)
@@ -28,7 +28,7 @@ DEPEND="${RDEPEND}"
 S="${WORKDIR}/${P}/${PN}"
 
 PATCHES=(
-       "${FILESDIR}/${P}-secure_socket.patch"
+       "${FILESDIR}/${PN}-20190603-secure_socket.patch"
 )
 
 src_prepare() {
@@ -51,7 +51,7 @@ src_configure() {
 src_install() {
        emake INSTALL_ROOT="${D}" install
 
-       newinitd "${FILESDIR}"/${PN}.initd ${PN}
+       newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
 }
 
 pkg_postinst() {