Skip to contentSkip to conversation

chronyd: Re-align fc file

PATCH New Luis Ressel 2 participants 4 messages May 8, 2017 – May 11, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 chronyd: Re-align fc file

---
 chronyd.fc | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
chronyd.fc +9 -9
index 66061ff..6b7f1ba 100644
@@ -1,19 +1,19 @@
-/etc/chrony\.keys	--	gen_context(system_u:object_r:chronyd_keys_t,s0)
+/etc/chrony\.keys			--	gen_context(system_u:object_r:chronyd_keys_t,s0)
 
-/etc/rc\.d/init\.d/chronyd	--	gen_context(system_u:object_r:chronyd_initrc_exec_t,s0)
+/etc/rc\.d/init\.d/chronyd		--	gen_context(system_u:object_r:chronyd_initrc_exec_t,s0)
 
-/usr/bin/chronyd	--	gen_context(system_u:object_r:chronyd_exec_t,s0)
+/usr/bin/chronyd			--	gen_context(system_u:object_r:chronyd_exec_t,s0)
 
 # Systend unit files
 /usr/lib/systemd/system/[^/]*chrony-wait.* --	gen_context(system_u:object_r:chronyd_unit_t,s0)
 /usr/lib/systemd/system/[^/]*chronyd.*	--	gen_context(system_u:object_r:chronyd_unit_t,s0)
 
-/usr/sbin/chronyd	--	gen_context(system_u:object_r:chronyd_exec_t,s0)
+/usr/sbin/chronyd			--	gen_context(system_u:object_r:chronyd_exec_t,s0)
 
-/var/lib/chrony(/.*)?	gen_context(system_u:object_r:chronyd_var_lib_t,s0)
+/var/lib/chrony(/.*)?				gen_context(system_u:object_r:chronyd_var_lib_t,s0)
 
-/var/log/chrony(/.*)?	gen_context(system_u:object_r:chronyd_var_log_t,s0)
+/var/log/chrony(/.*)?				gen_context(system_u:object_r:chronyd_var_log_t,s0)
 
-/run/chronyd(/.*)	gen_context(system_u:object_r:chronyd_var_run_t,s0)
-/run/chronyd\.pid	--	gen_context(system_u:object_r:chronyd_var_run_t,s0)
-/run/chronyd\.sock	-s	gen_context(system_u:object_r:chronyd_var_run_t,s0)
+/run/chronyd(/.*)				gen_context(system_u:object_r:chronyd_var_run_t,s0)
+/run/chronyd\.pid			--	gen_context(system_u:object_r:chronyd_var_run_t,s0)
+/run/chronyd\.sock			-s	gen_context(system_u:object_r:chronyd_var_run_t,s0)
Signature · 1 line
2.12.2
#1 lore raw

PATCH 2/2 chronyd: Allow init scripts to create /run/chrony

Remark: So far, chronyd.fc only contains /run/chronyd, but chrony's default location is actually /run/chrony, so I've added that to the fc.

This commit also fixes a bug in the fc: It said (/.*) instead of (/.*)?

---
 chronyd.fc | 2 +-
 chronyd.te | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
chronyd.fc +1 -1
index 6b7f1ba..5ee3551 100644
@@ -14,6 +14,6 @@
 
 /var/log/chrony(/.*)?				gen_context(system_u:object_r:chronyd_var_log_t,s0)
 
-/run/chronyd(/.*)				gen_context(system_u:object_r:chronyd_var_run_t,s0)
+/run/chronyd?(/.*)?				gen_context(system_u:object_r:chronyd_var_run_t,s0)
 /run/chronyd\.pid			--	gen_context(system_u:object_r:chronyd_var_run_t,s0)
 /run/chronyd\.sock			-s	gen_context(system_u:object_r:chronyd_var_run_t,s0)
chronyd.te +1 -1
index 3e9a1c5..62ddd0b 100644
@@ -28,7 +28,7 @@ type chronyd_var_log_t;
 logging_log_file(chronyd_var_log_t)
 
 type chronyd_var_run_t;
-files_pid_file(chronyd_var_run_t)
+init_daemon_pid_file(chronyd_var_run_t, dir, "chrony")
 
 ########################################
 #
Signature · 1 line
2.12.2
#2 lore raw

PATCH 2/2 chronyd: Allow init scripts to create /run/chrony

Quoted 26 lines · Luis Ressel via refpolicy

Remark: So far, chronyd.fc only contains /run/chronyd, but chrony's default location is actually /run/chrony, so I've added that to the fc.

This commit also fixes a bug in the fc: It said (/.*) instead of (/.*)?

---
 chronyd.fc | 2 +-
 chronyd.te | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
chronyd.fc +1 -1
index 6b7f1ba..5ee3551 100644
@@ -14,6 +14,6 @@
 
 /var/log/chrony(/.*)?				gen_context(system_u:object_r:chronyd_var_log_t,s0)
 
-/run/chronyd(/.*)				gen_context(system_u:object_r:chronyd_var_run_t,s0)
+/run/chronyd?(/.*)?				gen_context(system_u:object_r:chronyd_var_run_t,s0)
 /run/chronyd\.pid			--	gen_context(system_u:object_r:chronyd_var_run_t,s0)
 /run/chronyd\.sock			-s	gen_context(system_u:object_r:chronyd_var_run_t,s0)
chronyd.te +0 -0
index 3e9a1c5..62ddd0b 100644

chronyd.te type chronyd_var_log_t; · line 34

Quoted 8 lines
chronyd.te +1 -1
@@ -28,7 +28,7 @@ type chronyd_var_log_t;
 logging_log_file(chronyd_var_log_t)
 
 type chronyd_var_run_t;
-files_pid_file(chronyd_var_run_t)
+init_daemon_pid_file(chronyd_var_run_t, dir, "chrony")
 
 ########################################
 #

Merged.

Signature · 1 line
Chris PeBenito
#3 lore raw

PATCH 1/2 chronyd: Re-align fc file

In reply to Luis Ressel
Quoted 27 lines · Luis Ressel via refpolicy
---
 chronyd.fc | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
chronyd.fc +5 -5
index 66061ff..6b7f1ba 100644
@@ -1,19 +1,19 @@
-/etc/chrony\.keys	--	gen_context(system_u:object_r:chronyd_keys_t,s0)
+/etc/chrony\.keys			--	gen_context(system_u:object_r:chronyd_keys_t,s0)
 
-/etc/rc\.d/init\.d/chronyd	--	gen_context(system_u:object_r:chronyd_initrc_exec_t,s0)
+/etc/rc\.d/init\.d/chronyd		--	gen_context(system_u:object_r:chronyd_initrc_exec_t,s0)
 
-/usr/bin/chronyd	--	gen_context(system_u:object_r:chronyd_exec_t,s0)
+/usr/bin/chronyd			--	gen_context(system_u:object_r:chronyd_exec_t,s0)
 
 # Systend unit files
 /usr/lib/systemd/system/[^/]*chrony-wait.* --	gen_context(system_u:object_r:chronyd_unit_t,s0)
 /usr/lib/systemd/system/[^/]*chronyd.*	--	gen_context(system_u:object_r:chronyd_unit_t,s0)
 
-/usr/sbin/chronyd	--	gen_context(system_u:object_r:chronyd_exec_t,s0)
+/usr/sbin/chronyd			--	gen_context(system_u:object_r:chronyd_exec_t,s0)
 
-/var/lib/chrony(/.*)?	gen_context(system_u:object_r:chronyd_var_lib_t,s0)
+/var/lib/chrony(/.*)?				gen_context(system_u:object_r:chronyd_var_lib_t,s0)

chronyd.fc line 19

Quoted 10 lines
chronyd.fc +4 -4
 
-/var/log/chrony(/.*)?	gen_context(system_u:object_r:chronyd_var_log_t,s0)
+/var/log/chrony(/.*)?				gen_context(system_u:object_r:chronyd_var_log_t,s0)
 
-/run/chronyd(/.*)	gen_context(system_u:object_r:chronyd_var_run_t,s0)
-/run/chronyd\.pid	--	gen_context(system_u:object_r:chronyd_var_run_t,s0)
-/run/chronyd\.sock	-s	gen_context(system_u:object_r:chronyd_var_run_t,s0)
+/run/chronyd(/.*)				gen_context(system_u:object_r:chronyd_var_run_t,s0)
+/run/chronyd\.pid			--	gen_context(system_u:object_r:chronyd_var_run_t,s0)
+/run/chronyd\.sock			-s	gen_context(system_u:object_r:chronyd_var_run_t,s0)

Merged.

Signature · 1 line
Chris PeBenito