selinux-policy/refpolicy/policy/modules/system/hostname.if

99 lines
2.5 KiB
Plaintext
Raw Normal View History

2005-06-07 22:36:07 +00:00
## <module name="hostname" layer="system">
2005-05-27 21:56:01 +00:00
## <summary>Policy for changing the system host name.</summary>
2005-05-09 13:26:33 +00:00
2005-05-27 21:56:01 +00:00
########################################
2005-06-13 17:35:46 +00:00
## <interface name="hostname_domtrans">
2005-05-27 21:56:01 +00:00
## <description>
## Execute hostname in the hostname domain.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## Has a sigchld signal backchannel.
2005-05-27 21:56:01 +00:00
## </parameter>
## </interface>
2005-05-09 13:26:33 +00:00
#
2005-06-13 17:35:46 +00:00
define(`hostname_domtrans',`
gen_require(`$0'_depend)
2005-06-09 14:50:48 +00:00
allow $1 hostname_exec_t:file rx_file_perms;
allow $1 hostname_t:process transition;
type_transition $1 hostname_exec_t:process hostname_t;
dontaudit $1 hostname_t:process { noatsecure siginh rlimitinh };
allow $1 hostname_t:fd use;
allow hostname_t $1:fd use;
allow hostname_t $1:fifo_file rw_file_perms;
allow hostname_t $1:process sigchld;
2005-05-09 13:26:33 +00:00
')
2005-06-13 17:35:46 +00:00
define(`hostname_domtrans_depend',`
type hostname_t, hostname_exec_t;
2005-06-09 14:50:48 +00:00
class file rx_file_perms;
class process { transition noatsecure siginh rlimitinh sigchld };
class fd use;
class fifo_file rw_file_perms;
2005-05-09 13:26:33 +00:00
')
2005-05-27 21:56:01 +00:00
########################################
2005-06-13 17:35:46 +00:00
## <interface name="hostname_run">
2005-05-27 21:56:01 +00:00
## <description>
## Execute hostname in the hostname domain, and
## allow the specified role the hostname domain.
## Has a sigchld signal backchannel.
2005-05-27 21:56:01 +00:00
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## <parameter name="role">
## The role to be allowed the hostname domain.
## </parameter>
## <parameter name="terminal">
## The type of the terminal allow the hostname domain to use.
## </parameter>
## </interface>
#
2005-06-13 17:35:46 +00:00
define(`hostname_run',`
gen_require(`$0'_depend)
2005-06-13 17:35:46 +00:00
hostname_domtrans($1)
role $2 types hostname_t;
allow hostname_t $3:chr_file { getattr read write ioctl };
2005-05-27 21:56:01 +00:00
')
2005-06-13 17:35:46 +00:00
define(`hostname_run_depend',`
type hostname_t;
class chr_file { getattr read write ioctl };
2005-05-27 21:56:01 +00:00
')
2005-06-07 22:36:07 +00:00
########################################
2005-06-13 17:35:46 +00:00
## <interface name="hostname_exec">
2005-06-07 22:36:07 +00:00
## <description>
## Execute hostname in the hostname domain, and
## Has a sigchld signal backchannel.
## </description>
## <parameter name="domain">
## The type of the process performing this action.
## </parameter>
## </interface>
#
2005-05-09 13:26:33 +00:00
#######################################
#
2005-06-13 17:35:46 +00:00
# hostname_exec(domain)
2005-05-09 13:26:33 +00:00
#
2005-06-13 17:35:46 +00:00
define(`hostname_exec',`
gen_require(`$0'_depend)
2005-06-09 14:50:48 +00:00
can_exec($1,hostname_exec_t)
2005-05-09 13:26:33 +00:00
')
2005-06-13 17:35:46 +00:00
define(`hostname_exec_depend',`
type hostname_exec_t;
class file { getattr read execute execute_no_trans };
2005-05-09 13:26:33 +00:00
')
2005-05-27 21:56:01 +00:00
## </module>