Chris PeBenito ab58ad
#DESC games
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Macros for games
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# Authors:  Dan Walsh <dwalsh@redhat.com> 
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
# games_domain(domain_prefix)
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
#
Chris PeBenito ab58ad
define(`games_domain', `
Chris PeBenito ab58ad
Chris PeBenito ab58ad
type $1_games_t, domain, nscd_client_domain;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Type transition
Chris PeBenito ab58ad
if (! disable_games_trans) {
Chris PeBenito ab58ad
domain_auto_trans($1_t, games_exec_t, $1_games_t)
Chris PeBenito ab58ad
}
Chris PeBenito ab58ad
can_exec($1_games_t, games_exec_t)
Chris PeBenito ab58ad
role $1_r types $1_games_t;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
can_create_pty($1_games)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# X access, GNOME, /tmp files
Chris PeBenito ab58ad
x_client_domain($1_games, $1)
Chris PeBenito ab58ad
tmp_domain($1_games, `', { dir notdevfile_class_set })
Chris PeBenito ab58ad
gnome_application($1_games, $1)
Chris PeBenito ab58ad
gnome_file_dialog($1_games, $1)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Games seem to need this
Chris PeBenito ab58ad
if (allow_execmem) {
Chris PeBenito ab58ad
allow $1_games_t self:process execmem;
Chris PeBenito ab58ad
}
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_games_t texrel_shlib_t:file execmod;
Chris PeBenito ab58ad
allow $1_games_t var_t:dir { search getattr };
Chris PeBenito ab58ad
rw_dir_create_file($1_games_t, games_data_t)
Chris PeBenito ab58ad
allow $1_games_t sound_device_t:chr_file rw_file_perms;
Chris PeBenito ab58ad
can_udp_send($1_games_t, $1_games_t)
Chris PeBenito ab58ad
can_tcp_connect($1_games_t, $1_games_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Access /home/user/.gnome2
Chris PeBenito ab58ad
# FIXME: Change to use per app types
Chris PeBenito ab58ad
create_dir_file($1_games_t, $1_gnome_settings_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# FIXME: why is this necessary - ORBit?
Chris PeBenito ab58ad
# ORBit works differently now
Chris PeBenito ab58ad
create_dir_file($1_games_t, $1_tmp_t)
Chris PeBenito ab58ad
allow $1_games_t $1_tmp_t:sock_file create_file_perms;
Chris PeBenito ab58ad
can_unix_connect($1_t, $1_games_t)
Chris PeBenito ab58ad
can_unix_connect($1_games_t, $1_t)
Chris PeBenito ab58ad
Chris PeBenito ab58ad
ifdef(`xdm.te', `
Chris PeBenito ab58ad
allow $1_games_t xdm_tmp_t:dir rw_dir_perms;
Chris PeBenito ab58ad
allow $1_games_t xdm_tmp_t:sock_file create_file_perms;
Chris PeBenito ab58ad
allow $1_games_t xdm_var_lib_t:file { getattr read };
Chris PeBenito ab58ad
')dnl end if xdm.te
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_games_t var_lib_t:dir search;
Chris PeBenito ab58ad
r_dir_file($1_games_t, man_t)
Chris PeBenito ab58ad
allow $1_games_t { proc_t self }:dir search;
Chris PeBenito ab58ad
allow $1_games_t { proc_t self }:{ file lnk_file } { read getattr };
Chris PeBenito ab58ad
ifdef(`mozilla.te', ` 
Chris PeBenito ab58ad
dontaudit $1_games_t $1_mozilla_t:unix_stream_socket connectto;
Chris PeBenito ab58ad
')
Chris PeBenito ab58ad
allow $1_games_t event_device_t:chr_file getattr;
Chris PeBenito ab58ad
allow $1_games_t mouse_device_t:chr_file getattr;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_games_t self:file { getattr read };
Chris PeBenito ab58ad
allow $1_games_t self:sem create_sem_perms;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
allow $1_games_t { bin_t sbin_t }:dir { getattr search };
Chris PeBenito ab58ad
can_exec($1_games_t, { shell_exec_t bin_t utempter_exec_t })
Chris PeBenito ab58ad
allow $1_games_t bin_t:lnk_file read;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
dontaudit $1_games_t var_run_t:dir search;
Chris PeBenito ab58ad
dontaudit $1_games_t initrc_var_run_t:file { read write };
Chris PeBenito ab58ad
dontaudit $1_games_t var_log_t:dir search;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
can_network($1_games_t)
Chris PeBenito ab58ad
allow $1_games_t port_t:tcp_socket name_bind;
Chris PeBenito ab58ad
allow $1_games_t port_t:tcp_socket name_connect;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
# Suppress .icons denial until properly implemented
Chris PeBenito ab58ad
dontaudit $1_games_t $1_home_t:dir read;
Chris PeBenito ab58ad
Chris PeBenito ab58ad
')dnl end macro definition
Chris PeBenito ab58ad