rpms/xpilot-ng/devel xpilotd.fc, NONE, 1.1 xpilotd.if, NONE, 1.1 xpilotd.te, NONE, 1.1
Michael Thomas (wart)
fedora-extras-commits at redhat.com
Wed Aug 30 04:07:07 UTC 2006
Author: wart
Update of /cvs/extras/rpms/xpilot-ng/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv10140
Added Files:
xpilotd.fc xpilotd.if xpilotd.te
Log Message:
Add xpilot policy files
--- NEW FILE xpilotd.fc ---
# xpilot-ng-server executable will have:
# label: system_u:object_r:xpilotd_exec_t
# MLS sensitivity: s0
# MCS categories: <none>
/usr/bin/xpilot-ng-server -- gen_context(system_u:object_r:xpilotd_exec_t,s0)
/etc/xpilot-ng(/.*)? gen_context(system_u:object_r:xpilotd_private_data_t)
--- NEW FILE xpilotd.if ---
## <summary>policy for xpilot-ng</summary>
########################################
## <summary>
## Execute a domain transition to run xpilot-ng-server.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed to transition.
## </summary>
## </param>
#
interface(`xpilotd_domtrans',`
gen_require(`
type xpilotd_t, xpilotd_exec_t;
')
domain_auto_trans($1,xpilotd_exec_t,xpilotd_t)
allow $1 xpilotd_t:fd use;
allow xpilotd_t $1:fd use;
allow xpilotd_t $1:fifo_file rw_file_perms;
allow xpilotd_t $1:process sigchld;
')
--- NEW FILE xpilotd.te ---
policy_module(xpilotd,1.0.0)
########################################
#
# Declarations
#
gen_require(`
type port_t;
attribute port_type;
type var_log_t;
')
type xpilotd_port_t, port_type;
type xpilotd_t;
type xpilotd_exec_t;
domain_type(xpilotd_t)
init_daemon_domain(xpilotd_t, xpilotd_exec_t)
# pid files
type xpilotd_var_run_t;
files_pid_file(xpilotd_var_run_t)
# Game data files
type xpilotd_private_data_t;
files_type(xpilotd_private_data_t);
########################################
#
# xpilot local policy
#
# Check in /etc/selinux/refpolicy/include for macros to use instead of allow rules.
# Note: /usr/share/selinux/devel/include/support/obj_perm_sets.spt contains
# the definitions of many permissions, such as 'rw_dir_perms'
# Some common macros (you might be able to remove some)
files_read_usr_files(xpilotd_t)
files_read_etc_files(xpilotd_t)
libs_use_ld_so(xpilotd_t)
libs_use_shared_libs(xpilotd_t)
miscfiles_read_localization(xpilotd_t)
## internal communication is often done using fifo and unix sockets.
allow xpilotd_t self:fifo_file { read write };
allow xpilotd_t self:unix_stream_socket create_stream_socket_perms;
# log files
allow xpilotd_t var_log_t:file rw_file_perms ;
## Networking basics (adjust to your needs!)
sysnet_dns_name_resolve(xpilotd_t)
corenet_udp_bind_all_nodes(xpilotd_t)
corenet_non_ipsec_sendrecv(xpilotd_t)
corenet_udp_sendrecv_all_ports(xpilotd_t)
allow xpilotd_t xpilotd_port_t:udp_socket { name_bind };
# Init script handling
init_use_fds(xpilotd_t)
init_use_script_ptys(xpilotd_t)
domain_use_interactive_fds(xpilotd_t)
# Game private data
allow xpilotd_t xpilotd_private_data_t:file { r_file_perms };
allow xpilotd_t xpilotd_private_data_t:dir search;
# Misc rules that are needed. I don't understand the meaning of some
# of these, and for others I don't yet understand why the game needs
# them
kernel_read_system_state(xpilotd_t)
allow xpilotd_t self:process signal;
More information about the fedora-extras-commits
mailing list