commit:     554169d137ed8565b7802bd3dcdf3d274f4ce4f1
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 13 14:06:14 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Jun 13 14:27:27 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=554169d1

x11-apps/radeon-profile-daemon: Adjusted live ebuild

Package-Manager: Portage-2.3.67, Repoman-2.3.14
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 ...eon-profile-daemon-20190603-secure_socket.patch | 26 ++++++++++++++++++++++
 .../files/radeon-profile-daemon.initd-r1           | 19 ++++++++++++++++
 .../radeon-profile-daemon-99999999.ebuild          |  4 ++--
 3 files changed, 47 insertions(+), 2 deletions(-)

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
index 00000000000..951e7d12e28
--- /dev/null
+++ 
b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon-20190603-secure_socket.patch
@@ -0,0 +1,26 @@
+From 47ddfbb7b85c3e99eb0d132078c989c0dfa2ea9b Mon Sep 17 00:00:00 2001
+From: Lars Wendler <[email protected]>
+Date: Thu, 13 Jun 2019 15:58:44 +0200
+Subject: [PATCH] Don't make the socket world writable
+
+Signed-off-by: Lars Wendler <[email protected]>
+---
+ 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
index 00000000000..813ab9515ae
--- /dev/null
+++ b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd-r1
@@ -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
+}

diff --git 
a/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild 
b/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild
index 924760fc909..77f7239752b 100644
--- a/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild
+++ b/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild
@@ -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() {

Reply via email to