1 |
commit: bf12cbcf32c902e9825583425340be3cb404dc09 |
2 |
Author: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 10 09:59:27 2019 +0000 |
4 |
Commit: Lars Wendler <polynomial-c <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 10 10:01:14 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf12cbcf |
7 |
|
8 |
x11-apps/radeon-profile-daemon: Secured socket permissions. |
9 |
|
10 |
Package-Manager: Portage-2.3.66, Repoman-2.3.12 |
11 |
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org> |
12 |
|
13 |
...eon-profile-daemon-20190309-secure_socket.patch | 26 ++++++++++++++++++++++ |
14 |
.../files/radeon-profile-daemon.initd | 4 ++++ |
15 |
...ld => radeon-profile-daemon-20190309-r2.ebuild} | 13 ++++++++++- |
16 |
.../radeon-profile-daemon-99999999.ebuild | 13 ++++++++++- |
17 |
4 files changed, 54 insertions(+), 2 deletions(-) |
18 |
|
19 |
diff --git a/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon-20190309-secure_socket.patch b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon-20190309-secure_socket.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..5d7132b90b7 |
22 |
--- /dev/null |
23 |
+++ b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon-20190309-secure_socket.patch |
24 |
@@ -0,0 +1,26 @@ |
25 |
+From 8e75c8678b874c6813e590634943166daa98124b Mon Sep 17 00:00:00 2001 |
26 |
+From: Lars Wendler <polynomial-c@g.o> |
27 |
+Date: Fri, 10 May 2019 11:01:21 +0200 |
28 |
+Subject: [PATCH] Don't make the socket world writable |
29 |
+ |
30 |
+Signed-off-by: Lars Wendler <polynomial-c@g.o> |
31 |
+--- |
32 |
+ radeon-profile-daemon/rpdthread.cpp | 2 +- |
33 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
34 |
+ |
35 |
+diff --git a/radeon-profile-daemon/rpdthread.cpp b/radeon-profile-daemon/rpdthread.cpp |
36 |
+index 4cf0ac0..137d5b2 100644 |
37 |
+--- a/radeon-profile-daemon/rpdthread.cpp |
38 |
++++ b/radeon-profile-daemon/rpdthread.cpp |
39 |
+@@ -47,7 +47,7 @@ void rpdThread::createServer() |
40 |
+ |
41 |
+ QLocalServer::removeServer(serverName); |
42 |
+ daemonServer.listen(serverName); |
43 |
+- QFile::setPermissions("/tmp/" + serverName, QFile("/tmp/" + serverName).permissions() | QFile::WriteOther | QFile::ReadOther); |
44 |
++ QFile::setPermissions("/tmp/" + serverName, QFile("/tmp/" + serverName).permissions() | QFile::WriteGroup | QFile::ReadGroup); |
45 |
+ } |
46 |
+ |
47 |
+ void rpdThread::closeConnection() |
48 |
+-- |
49 |
+2.21.0 |
50 |
+ |
51 |
|
52 |
diff --git a/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd |
53 |
index e4e7afb04c5..f8ec5179670 100644 |
54 |
--- a/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd |
55 |
+++ b/x11-apps/radeon-profile-daemon/files/radeon-profile-daemon.initd |
56 |
@@ -7,3 +7,7 @@ description="Daemon for radeon-profile GUI" |
57 |
command="/usr/sbin/radeon-profile-daemon" |
58 |
command_background="true" |
59 |
pidfile="/run/${SVCNAME}.pid" |
60 |
+ |
61 |
+start_post() { |
62 |
+ chgrp video /tmp/radeon-profile-daemon-server |
63 |
+} |
64 |
|
65 |
diff --git a/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild b/x11-apps/radeon-profile-daemon/radeon-profile-daemon-20190309-r2.ebuild |
66 |
similarity index 81% |
67 |
copy from x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild |
68 |
copy to x11-apps/radeon-profile-daemon/radeon-profile-daemon-20190309-r2.ebuild |
69 |
index ca74330cfd3..924760fc909 100644 |
70 |
--- a/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild |
71 |
+++ b/x11-apps/radeon-profile-daemon/radeon-profile-daemon-20190309-r2.ebuild |
72 |
@@ -27,8 +27,14 @@ DEPEND="${RDEPEND}" |
73 |
|
74 |
S="${WORKDIR}/${P}/${PN}" |
75 |
|
76 |
+PATCHES=( |
77 |
+ "${FILESDIR}/${P}-secure_socket.patch" |
78 |
+) |
79 |
+ |
80 |
src_prepare() { |
81 |
- default |
82 |
+ eapply -p2 "${PATCHES[@]}" |
83 |
+ eapply_user |
84 |
+ |
85 |
sed \ |
86 |
-e '/^bin\.path/s@/bin@/sbin@' \ |
87 |
-e "/^service\.path/s@=.*\$@= $(systemd_get_systemunitdir)@" \ |
88 |
@@ -47,3 +53,8 @@ src_install() { |
89 |
|
90 |
newinitd "${FILESDIR}"/${PN}.initd ${PN} |
91 |
} |
92 |
+ |
93 |
+pkg_postinst() { |
94 |
+ elog "Users need to be in the \"video\" group if they want to change" |
95 |
+ elog "video card settings via ${PN}" |
96 |
+} |
97 |
|
98 |
diff --git a/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild b/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild |
99 |
index ca74330cfd3..924760fc909 100644 |
100 |
--- a/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild |
101 |
+++ b/x11-apps/radeon-profile-daemon/radeon-profile-daemon-99999999.ebuild |
102 |
@@ -27,8 +27,14 @@ DEPEND="${RDEPEND}" |
103 |
|
104 |
S="${WORKDIR}/${P}/${PN}" |
105 |
|
106 |
+PATCHES=( |
107 |
+ "${FILESDIR}/${P}-secure_socket.patch" |
108 |
+) |
109 |
+ |
110 |
src_prepare() { |
111 |
- default |
112 |
+ eapply -p2 "${PATCHES[@]}" |
113 |
+ eapply_user |
114 |
+ |
115 |
sed \ |
116 |
-e '/^bin\.path/s@/bin@/sbin@' \ |
117 |
-e "/^service\.path/s@=.*\$@= $(systemd_get_systemunitdir)@" \ |
118 |
@@ -47,3 +53,8 @@ src_install() { |
119 |
|
120 |
newinitd "${FILESDIR}"/${PN}.initd ${PN} |
121 |
} |
122 |
+ |
123 |
+pkg_postinst() { |
124 |
+ elog "Users need to be in the \"video\" group if they want to change" |
125 |
+ elog "video card settings via ${PN}" |
126 |
+} |