1 |
commit: 9ae8da19583774e0eccb52e8108e89dfaa513bd7 |
2 |
Author: cgzones <cgzones <AT> googlemail <DOT> com> |
3 |
AuthorDate: Mon Feb 20 13:24:56 2017 +0000 |
4 |
Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Mar 2 10:16:45 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=9ae8da19 |
7 |
|
8 |
update init_ACTION_all_units |
9 |
|
10 |
When with systemd a program does not ship a systemd unit file but only a init script, systemd creates a pseudo service on the fly. |
11 |
To be able to act on this service, add the target attribute init_script_file_type to the init_ACTION_all_units interfaces. |
12 |
|
13 |
Useful for monit. |
14 |
|
15 |
policy/modules/system/init.if | 16 ++++++++-------- |
16 |
1 file changed, 8 insertions(+), 8 deletions(-) |
17 |
|
18 |
diff --git a/policy/modules/system/init.if b/policy/modules/system/init.if |
19 |
index 6a067ab2..195c5fa3 100644 |
20 |
--- a/policy/modules/system/init.if |
21 |
+++ b/policy/modules/system/init.if |
22 |
@@ -2843,11 +2843,11 @@ interface(`init_reload_generic_units',` |
23 |
# |
24 |
interface(`init_get_all_units_status',` |
25 |
gen_require(` |
26 |
- attribute systemdunit; |
27 |
+ attribute init_script_file_type, systemdunit; |
28 |
class service status; |
29 |
') |
30 |
|
31 |
- allow $1 systemdunit:service status; |
32 |
+ allow $1 { init_script_file_type systemdunit }:service status; |
33 |
') |
34 |
|
35 |
######################################## |
36 |
@@ -2862,11 +2862,11 @@ interface(`init_get_all_units_status',` |
37 |
# |
38 |
interface(`init_start_all_units',` |
39 |
gen_require(` |
40 |
- attribute systemdunit; |
41 |
+ attribute init_script_file_type, systemdunit; |
42 |
class service start; |
43 |
') |
44 |
|
45 |
- allow $1 systemdunit:service start; |
46 |
+ allow $1 { init_script_file_type systemdunit }:service start; |
47 |
') |
48 |
|
49 |
######################################## |
50 |
@@ -2881,11 +2881,11 @@ interface(`init_start_all_units',` |
51 |
# |
52 |
interface(`init_stop_all_units',` |
53 |
gen_require(` |
54 |
- attribute systemdunit; |
55 |
+ attribute init_script_file_type, systemdunit; |
56 |
class service stop; |
57 |
') |
58 |
|
59 |
- allow $1 systemdunit:service stop; |
60 |
+ allow $1 { init_script_file_type systemdunit }:service stop; |
61 |
') |
62 |
|
63 |
####################################### |
64 |
@@ -2900,9 +2900,9 @@ interface(`init_stop_all_units',` |
65 |
# |
66 |
interface(`init_reload_all_units',` |
67 |
gen_require(` |
68 |
- attribute systemdunit; |
69 |
+ attribute init_script_file_type, systemdunit; |
70 |
class service reload; |
71 |
') |
72 |
|
73 |
- allow $1 systemdunit:service reload; |
74 |
+ allow $1 { init_script_file_type systemdunit }:service reload; |
75 |
') |