Skip to content

Commit 46d44de

Browse files
committed
Introduce new type pdns_var_lib_t
Allow processes labeled as pdns_t to create new files and directories labeled as pdns_var_lib_t in directory /var/lib/pdns Resolves: rhbz#1364611
1 parent 7ca1db2 commit 46d44de

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

pdns.fc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@
44
/var/run/pdns\.pid -- gen_context(system_u:object_r:pdns_var_run_t,s0)
55
/var/run/pdns\.controlsocket -s gen_context(system_u:object_r:pdns_var_run_t,s0)
66
/etc/pdns(/.*)? gen_context(system_u:object_r:pdns_conf_t,s0)
7+
8+
/var/lib/pdns(/.*)? gen_context(system_u:object_r:pdns_var_lib_t,s0)

pdns.te

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ systemd_unit_file(pdns_unit_file_t)
2323
type pdns_conf_t;
2424
files_config_file(pdns_conf_t)
2525

26+
type pdns_var_lib_t;
27+
files_type(pdns_var_lib_t)
28+
2629
type pdns_var_run_t;
2730
files_pid_file(pdns_var_run_t)
2831

@@ -47,6 +50,10 @@ corenet_tcp_bind_dns_port(pdns_t)
4750
corenet_udp_bind_dns_port(pdns_t)
4851
corenet_tcp_bind_transproxy_port(pdns_t)
4952

53+
manage_dirs_pattern(pdns_t, pdns_var_lib_t, pdns_var_lib_t)
54+
manage_files_pattern(pdns_t, pdns_var_lib_t, pdns_var_lib_t)
55+
files_var_lib_filetrans(pdns_t, pdns_var_lib_t, { dir file })
56+
5057
files_pid_filetrans(pdns_t, pdns_var_run_t, { file sock_file })
5158
manage_files_pattern(pdns_t, pdns_var_run_t, pdns_var_run_t)
5259
manage_sock_files_pattern(pdns_t, pdns_var_run_t, pdns_var_run_t)

0 commit comments

Comments
 (0)