summaryrefslogtreecommitdiffstats
path: root/recipes-security/refpolicy/refpolicy-2.20140311/refpolicy-update-for_systemd.patch
blob: 80b420c45d8d74ae43d9bdf393d111116cde7367 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
refpolicy: update for systemd
 
It provides the systemd support for refpolicy 
and related allow rules. 
The restorecon provides systemd init labeled 
as init_exec_t.

Upstream-Status: Pending


Signed-off-by: Shrikant Bobade <Shrikant_Bobade@mentor.com>

--- a/policy/modules/contrib/shutdown.fc
+++ b/policy/modules/contrib/shutdown.fc
@@ -5,6 +5,9 @@
 /sbin/shutdown	--	gen_context(system_u:object_r:shutdown_exec_t,s0)
 /sbin/shutdown\.sysvinit	--	gen_context(system_u:object_r:shutdown_exec_t,s0)
 
+# systemd support
+/bin/systemctl	--	gen_context(system_u:object_r:shutdown_exec_t,s0)
+
 /usr/lib/upstart/shutdown	--	gen_context(system_u:object_r:shutdown_exec_t,s0)
 
 /usr/sbin/shutdown	--	gen_context(system_u:object_r:shutdown_exec_t,s0)
--- a/policy/modules/system/init.fc
+++ b/policy/modules/system/init.fc
@@ -31,6 +31,8 @@
 #
 /sbin/init(ng)?		--	gen_context(system_u:object_r:init_exec_t,s0)
 /sbin/init\.sysvinit	--	gen_context(system_u:object_r:init_exec_t,s0)
+# systemd support
+/lib/systemd/systemd	--	gen_context(system_u:object_r:init_exec_t,s0)
 # because nowadays, /sbin/init is often a symlink to /sbin/upstart
 /sbin/upstart		--	gen_context(system_u:object_r:init_exec_t,s0)
 
--- a/policy/modules/system/init.te
+++ b/policy/modules/system/init.te
@@ -913,3 +913,8 @@
 optional_policy(`
 	zebra_read_config(initrc_t)
 ')
+
+# systemd related allow rules
+allow kernel_t init_t:process dyntransition;
+allow devpts_t device_t:filesystem associate;
+allow init_t self:capability2 block_suspend;