1 |
commit: fe62598f2fb87fe0dfca34f82311ffd29df37795 |
2 |
Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be> |
3 |
AuthorDate: Sat Nov 22 18:46:23 2014 +0000 |
4 |
Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 22 18:46:23 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=fe62598f |
7 |
|
8 |
Reshuffle and update with upstream |
9 |
|
10 |
--- |
11 |
policy/modules/system/init.if | 82 ++++++++++++++++++++++++------------------- |
12 |
1 file changed, 46 insertions(+), 36 deletions(-) |
13 |
|
14 |
diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if |
15 |
index 2b7793a..99e42fc 100644 |
16 |
--- a/policy/modules/system/init.if |
17 |
+++ b/policy/modules/system/init.if |
18 |
@@ -150,39 +150,6 @@ interface(`init_ranged_domain',` |
19 |
|
20 |
######################################## |
21 |
## <summary> |
22 |
-## Mark the file type as a daemon pid file, allowing initrc_t |
23 |
-## to create it |
24 |
-## </summary> |
25 |
-## <param name="filetype"> |
26 |
-## <summary> |
27 |
-## Type to mark as a daemon pid file |
28 |
-## </summary> |
29 |
-## </param> |
30 |
-## <param name="class"> |
31 |
-## <summary> |
32 |
-## Class on which the type is applied |
33 |
-## </summary> |
34 |
-## </param> |
35 |
-## <param name="filename"> |
36 |
-## <summary> |
37 |
-## Filename of the file that the init script creates |
38 |
-## </summary> |
39 |
-## </param> |
40 |
-# |
41 |
-interface(`init_daemon_pid_file',` |
42 |
- gen_require(` |
43 |
- attribute daemonpidfile; |
44 |
- type initrc_t; |
45 |
- ') |
46 |
- |
47 |
- typeattribute $1 daemonpidfile; |
48 |
- |
49 |
- files_pid_file($1) |
50 |
- files_pid_filetrans(initrc_t, $1, $2, $3) |
51 |
-') |
52 |
- |
53 |
-######################################## |
54 |
-## <summary> |
55 |
## Create a domain for long running processes |
56 |
## (daemons/services) which are started by init scripts. |
57 |
## </summary> |
58 |
@@ -421,16 +388,50 @@ interface(`init_ranged_system_domain',` |
59 |
|
60 |
######################################## |
61 |
## <summary> |
62 |
-## Mark the type as a daemon run dir |
63 |
+## Mark the file type as a daemon pid file, allowing initrc_t |
64 |
+## to create it |
65 |
## </summary> |
66 |
-## <param name="rundirtype"> |
67 |
+## <param name="filetype"> |
68 |
+## <summary> |
69 |
+## Type to mark as a daemon pid file |
70 |
+## </summary> |
71 |
+## </param> |
72 |
+## <param name="class"> |
73 |
+## <summary> |
74 |
+## Class on which the type is applied |
75 |
+## </summary> |
76 |
+## </param> |
77 |
+## <param name="filename"> |
78 |
+## <summary> |
79 |
+## Filename of the file that the init script creates |
80 |
+## </summary> |
81 |
+## </param> |
82 |
+# |
83 |
+interface(`init_daemon_pid_file',` |
84 |
+ gen_require(` |
85 |
+ attribute daemonpidfile; |
86 |
+ type initrc_t; |
87 |
+ ') |
88 |
+ |
89 |
+ typeattribute $1 daemonpidfile; |
90 |
+ |
91 |
+ files_pid_file($1) |
92 |
+ files_pid_filetrans(initrc_t, $1, $2, $3) |
93 |
+') |
94 |
+ |
95 |
+######################################## |
96 |
+## <summary> |
97 |
+## Mark the file type as a daemon run dir, allowing initrc_t |
98 |
+## to create it |
99 |
+## </summary> |
100 |
+## <param name="filetype"> |
101 |
## <summary> |
102 |
## Type to mark as a daemon run dir |
103 |
## </summary> |
104 |
## </param> |
105 |
## <param name="filename"> |
106 |
## <summary> |
107 |
-## Name of the run dir directory |
108 |
+## Filename of the directory that the init script creates |
109 |
## </summary> |
110 |
## </param> |
111 |
# |
112 |
@@ -843,6 +844,14 @@ interface(`init_spec_domtrans_script',` |
113 |
files_list_etc($1) |
114 |
spec_domtrans_pattern($1, initrc_exec_t, initrc_t) |
115 |
|
116 |
+ ifdef(`distro_gentoo',` |
117 |
+ gen_require(` |
118 |
+ type rc_exec_t; |
119 |
+ ') |
120 |
+ |
121 |
+ domtrans_pattern($1, rc_exec_t, initrc_t) |
122 |
+ ') |
123 |
+ |
124 |
ifdef(`enable_mcs',` |
125 |
range_transition $1 initrc_exec_t:process s0; |
126 |
') |
127 |
@@ -882,6 +891,7 @@ interface(`init_domtrans_script',` |
128 |
gen_require(` |
129 |
type rc_exec_t; |
130 |
') |
131 |
+ |
132 |
domtrans_pattern($1, rc_exec_t, initrc_t) |
133 |
') |
134 |
') |