selinux-policy/policy/modules/apps/tvtime.if

144 lines
4.4 KiB
Plaintext
Raw Normal View History

2006-02-01 15:11:43 +00:00
## <summary> tvtime - a high quality television application </summary>
#######################################
## <summary>
## The per user domain template for the tvtime module.
## </summary>
## <desc>
## <p>
## This template creates a derived domains which are used
## for tvtime.
## </p>
## <p>
## This template is invoked automatically for each user, and
## generally does not need to be invoked directly
## by policy writers.
## </p>
## </desc>
## <param name="userdomain_prefix">
## <summary>
2006-02-01 15:11:43 +00:00
## The prefix of the user domain (e.g., user
## is the prefix for user_t).
## </summary>
2006-02-01 15:11:43 +00:00
## </param>
## <param name="user_domain">
## <summary>
2006-02-01 15:11:43 +00:00
## The type of the user domain.
## </summary>
2006-02-01 15:11:43 +00:00
## </param>
## <param name="user_role">
## <summary>
2006-02-01 15:11:43 +00:00
## The role associated with the user domain.
## </summary>
2006-02-01 15:11:43 +00:00
## </param>
#
template(`tvtime_per_userdomain_template',`
########################################
#
# Declarations
#
type $1_tvtime_t;
domain_type($1_tvtime_t)
domain_entry_file($1_tvtime_t,tvtime_exec_t)
role $3 types $1_tvtime_t;
type $1_tvtime_home_t alias $1_tvtime_rw_t;
2006-02-21 18:40:44 +00:00
userdom_user_home_content($1,$1_tvtime_home_t)
2006-02-01 15:11:43 +00:00
files_poly_member($1_tvtime_home_t)
type $1_tvtime_tmp_t;
files_tmp_file($1_tvtime_tmp_t)
2006-02-15 16:42:51 +00:00
type $1_tvtime_tmpfs_t;
files_tmpfs_file($1_tvtime_tmpfs_t)
2006-02-01 15:11:43 +00:00
########################################
#
# Local policy
#
allow $1_tvtime_t self:capability { setuid sys_nice sys_resource };
allow $1_tvtime_t self:process setsched;
allow $1_tvtime_t self:unix_dgram_socket rw_socket_perms;
allow $1_tvtime_t self:unix_stream_socket rw_stream_socket_perms;
# X access, Home files
allow $1_tvtime_t $1_tvtime_home_t:dir manage_dir_perms;
allow $1_tvtime_t $1_tvtime_home_t:file manage_file_perms;
allow $1_tvtime_t $1_tvtime_home_t:lnk_file create_lnk_perms;
type_transition $1_tvtime_t $1_home_dir_t:dir $1_tvtime_home_t;
2006-02-21 18:40:44 +00:00
userdom_user_home_dir_filetrans($1,$1_tvtime_t,$1_tvtime_home_t,dir)
2006-02-01 15:11:43 +00:00
allow $1_tvtime_t $1_tvtime_tmp_t:dir create_dir_perms;
allow $1_tvtime_t $1_tvtime_tmp_t:file create_file_perms;
2006-02-21 18:40:44 +00:00
files_tmp_filetrans($1_tvtime_t, $1_tvtime_tmp_t, { file dir fifo_file })
2006-02-15 16:42:51 +00:00
allow $1_tvtime_t $1_tvtime_tmpfs_t:dir { read getattr lock search ioctl add_name remove_name write };
allow $1_tvtime_t $1_tvtime_tmpfs_t:file { create ioctl read getattr lock write setattr append link unlink rename };
allow $1_tvtime_t $1_tvtime_tmpfs_t:lnk_file { create read getattr setattr link unlink rename };
allow $1_tvtime_t $1_tvtime_tmpfs_t:sock_file { create ioctl read getattr lock write setattr append link unlink rename };
allow $1_tvtime_t $1_tvtime_tmpfs_t:fifo_file { create ioctl read getattr lock write setattr append link unlink rename };
2006-02-21 18:40:44 +00:00
fs_tmpfs_filetrans($1_tvtime_t,$1_tvtime_tmpfs_t,{ dir file lnk_file sock_file fifo_file })
2006-02-01 15:11:43 +00:00
# Type transition
domain_auto_trans($2, tvtime_exec_t, $1_tvtime_t)
allow $2 $1_tvtime_t:fd use;
allow $1_tvtime_t $2:fd use;
allow $1_tvtime_t $2:fifo_file rw_file_perms;
allow $1_tvtime_t $2:process sigchld;
# X access, Home files
allow $2 $1_tvtime_home_t:dir manage_dir_perms;
allow $2 $1_tvtime_home_t:file manage_file_perms;
allow $2 $1_tvtime_home_t:lnk_file create_lnk_perms;
allow $2 $1_tvtime_home_t:{ dir file lnk_file } { relabelfrom relabelto };
# Allow the user domain to signal/ps.
allow $2 $1_tvtime_t:dir { search getattr read };
allow $2 $1_tvtime_t:{ file lnk_file } { read getattr };
allow $2 $1_tvtime_t:process getattr;
allow $2 $1_tvtime_t:process signal_perms;
2006-02-02 15:36:00 +00:00
kernel_read_all_sysctls($1_tvtime_t)
2006-02-01 15:11:43 +00:00
kernel_get_sysvipc_info($1_tvtime_t)
dev_read_urand($1_tvtime_t)
dev_read_realtime_clock($1_tvtime_t)
2006-02-02 15:36:00 +00:00
dev_read_sound($1_tvtime_t)
2006-02-01 15:11:43 +00:00
files_read_usr_files($1_tvtime_t)
files_search_pids($1_tvtime_t)
# Read /etc/tvtime
files_read_etc_files($1_tvtime_t)
# X access, Home files
fs_search_auto_mountpoints($1_tvtime_t)
libs_use_ld_so($1_tvtime_t)
libs_use_shared_libs($1_tvtime_t)
miscfiles_read_localization($1_tvtime_t)
miscfiles_read_fonts($1_tvtime_t)
userdom_use_user_terminals($1,$1_tvtime_t)
2006-02-21 18:40:44 +00:00
userdom_read_user_home_content_files($1,$1_tvtime_t)
2006-02-01 15:11:43 +00:00
# X access, Home files
tunable_policy(`use_nfs_home_dirs',`
fs_manage_nfs_dirs($1_tvtime_t)
fs_manage_nfs_files($1_tvtime_t)
fs_manage_nfs_symlinks($1_tvtime_t)
')
tunable_policy(`use_samba_home_dirs',`
fs_manage_cifs_dirs($1_tvtime_t)
fs_manage_cifs_files($1_tvtime_t)
fs_manage_cifs_symlinks($1_tvtime_t)
')
optional_policy(`
2006-02-15 16:42:51 +00:00
xserver_user_client_template($1,$1_tvtime_t,$1_tvtime_tmpfs_t)
2006-02-01 15:11:43 +00:00
')
')