1 |
commit: e848a95c2e0d96123aead79676beaf7084ac8d31 |
2 |
Author: Jason Zaman <jason <AT> perfinion <DOT> com> |
3 |
AuthorDate: Wed Nov 18 06:05:29 2015 +0000 |
4 |
Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Nov 18 06:06:06 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=e848a95c |
7 |
|
8 |
ntp: add perms for socket /run/ntpd.sock for openntpd |
9 |
|
10 |
policy/modules/contrib/ntp.fc | 1 + |
11 |
policy/modules/contrib/ntp.te | 3 ++- |
12 |
2 files changed, 3 insertions(+), 1 deletion(-) |
13 |
|
14 |
diff --git a/policy/modules/contrib/ntp.fc b/policy/modules/contrib/ntp.fc |
15 |
index c01eb54..b58ce47 100644 |
16 |
--- a/policy/modules/contrib/ntp.fc |
17 |
+++ b/policy/modules/contrib/ntp.fc |
18 |
@@ -27,6 +27,7 @@ |
19 |
/var/log/xntpd.* -- gen_context(system_u:object_r:ntpd_log_t,s0) |
20 |
|
21 |
/var/run/ntpd\.pid -- gen_context(system_u:object_r:ntpd_var_run_t,s0) |
22 |
+/var/run/ntpd\.sock -s gen_context(system_u:object_r:ntpd_var_run_t,s0) |
23 |
|
24 |
ifdef(`distro_gentoo',` |
25 |
/usr/bin/sntp -- gen_context(system_u:object_r:ntpdate_exec_t,s0) |
26 |
|
27 |
diff --git a/policy/modules/contrib/ntp.te b/policy/modules/contrib/ntp.te |
28 |
index 2425edc..7af3a6d 100644 |
29 |
--- a/policy/modules/contrib/ntp.te |
30 |
+++ b/policy/modules/contrib/ntp.te |
31 |
@@ -78,7 +78,8 @@ manage_files_pattern(ntpd_t, ntpd_tmpfs_t, ntpd_tmpfs_t) |
32 |
fs_tmpfs_filetrans(ntpd_t, ntpd_tmpfs_t, { dir file }) |
33 |
|
34 |
manage_files_pattern(ntpd_t, ntpd_var_run_t, ntpd_var_run_t) |
35 |
-files_pid_filetrans(ntpd_t, ntpd_var_run_t, file) |
36 |
+manage_sock_files_pattern(ntpd_t, ntpd_var_run_t, ntpd_var_run_t) |
37 |
+files_pid_filetrans(ntpd_t, ntpd_var_run_t, { file sock_file }) |
38 |
|
39 |
can_exec(ntpd_t, ntpd_exec_t) |