2006-01-19 23:00:23 +00:00
|
|
|
## <summary>Wine Is Not an Emulator. Run Windows programs in Linux.</summary>
|
|
|
|
|
2010-02-19 14:17:51 +00:00
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## The per role template for the wine module.
|
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## This template creates a derived domains which are used
|
|
|
|
## for wine applications.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="userdomain_prefix">
|
|
|
|
## <summary>
|
|
|
|
## The prefix of the user domain (e.g., user
|
|
|
|
## is the prefix for user_t).
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="user_domain">
|
|
|
|
## <summary>
|
|
|
|
## The type of the user domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="user_role">
|
|
|
|
## <summary>
|
|
|
|
## The role associated with the user domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
template(`wine_role',`
|
|
|
|
gen_require(`
|
2010-08-26 13:41:21 +00:00
|
|
|
type wine_t;
|
|
|
|
type wine_home_t;
|
2010-02-19 14:17:51 +00:00
|
|
|
type wine_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
role $1 types wine_t;
|
|
|
|
|
|
|
|
domain_auto_trans($2, wine_exec_t, wine_t)
|
2010-08-26 13:41:21 +00:00
|
|
|
# Unrestricted inheritance from the caller.
|
|
|
|
allow $2 wine_t:process { noatsecure siginh rlimitinh };
|
2010-02-19 14:17:51 +00:00
|
|
|
allow wine_t $2:fd use;
|
|
|
|
allow wine_t $2:process { sigchld signull };
|
|
|
|
allow wine_t $2:unix_stream_socket connectto;
|
|
|
|
|
|
|
|
# Allow the user domain to signal/ps.
|
|
|
|
ps_process_pattern($2, wine_t)
|
|
|
|
allow $2 wine_t:process signal_perms;
|
|
|
|
|
|
|
|
allow $2 wine_t:fd use;
|
2010-08-30 15:15:53 +00:00
|
|
|
allow $2 wine_t:shm { associate getattr unix_read unix_write };
|
2010-02-19 14:17:51 +00:00
|
|
|
allow $2 wine_t:unix_stream_socket connectto;
|
|
|
|
|
|
|
|
# X access, Home files
|
|
|
|
manage_dirs_pattern($2, wine_home_t, wine_home_t)
|
|
|
|
manage_files_pattern($2, wine_home_t, wine_home_t)
|
|
|
|
manage_lnk_files_pattern($2, wine_home_t, wine_home_t)
|
|
|
|
relabel_dirs_pattern($2, wine_home_t, wine_home_t)
|
|
|
|
relabel_files_pattern($2, wine_home_t, wine_home_t)
|
|
|
|
relabel_lnk_files_pattern($2, wine_home_t, wine_home_t)
|
|
|
|
')
|
|
|
|
|
|
|
|
#######################################
|
|
|
|
## <summary>
|
|
|
|
## The role template for the wine module.
|
|
|
|
## </summary>
|
|
|
|
## <desc>
|
|
|
|
## <p>
|
|
|
|
## This template creates a derived domains which are used
|
|
|
|
## for wine applications.
|
|
|
|
## </p>
|
|
|
|
## </desc>
|
|
|
|
## <param name="role_prefix">
|
|
|
|
## <summary>
|
|
|
|
## The prefix of the user domain (e.g., user
|
|
|
|
## is the prefix for user_t).
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="user_role">
|
|
|
|
## <summary>
|
|
|
|
## The role associated with the user domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="user_domain">
|
|
|
|
## <summary>
|
|
|
|
## The type of the user domain.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
template(`wine_role_template',`
|
|
|
|
gen_require(`
|
2010-08-26 13:41:21 +00:00
|
|
|
type wine_t;
|
2010-02-19 14:17:51 +00:00
|
|
|
type wine_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
type $1_wine_t;
|
|
|
|
domain_type($1_wine_t)
|
|
|
|
domain_entry_file($1_wine_t, wine_exec_t)
|
|
|
|
ubac_constrained($1_wine_t)
|
|
|
|
role $2 types $1_wine_t;
|
|
|
|
|
|
|
|
allow $1_wine_t self:process { execmem execstack };
|
|
|
|
allow $3 $1_wine_t:process { getattr ptrace noatsecure signal_perms };
|
|
|
|
domtrans_pattern($3, wine_exec_t, $1_wine_t)
|
|
|
|
corecmd_bin_domtrans($1_wine_t, $1_t)
|
|
|
|
|
|
|
|
userdom_unpriv_usertype($1, $1_wine_t)
|
2010-08-26 13:41:21 +00:00
|
|
|
userdom_manage_tmpfs_role($2, $1_wine_t)
|
2010-02-19 14:17:51 +00:00
|
|
|
|
2010-09-01 18:55:04 +00:00
|
|
|
domain_mmap_low($1_wine_t)
|
2010-08-26 13:41:21 +00:00
|
|
|
|
|
|
|
tunable_policy(`wine_mmap_zero_ignore',`
|
|
|
|
dontaudit $1_wine_t self:memprotect mmap_zero;
|
|
|
|
')
|
2010-02-19 14:17:51 +00:00
|
|
|
|
2010-09-01 13:32:55 +00:00
|
|
|
tunable_policy(`wine_mmap_zero_ignore',`
|
|
|
|
dontaudit $1_wine_t self:memprotect mmap_zero;
|
|
|
|
')
|
|
|
|
|
2010-02-19 14:17:51 +00:00
|
|
|
optional_policy(`
|
|
|
|
xserver_role($1_r, $1_wine_t)
|
|
|
|
')
|
|
|
|
')
|
|
|
|
|
2006-01-19 23:00:23 +00:00
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute the wine program in the wine domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
2006-02-10 18:41:53 +00:00
|
|
|
## <summary>
|
2010-08-03 15:53:36 +00:00
|
|
|
## Domain allowed to transition.
|
2006-02-10 18:41:53 +00:00
|
|
|
## </summary>
|
2006-01-19 23:00:23 +00:00
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`wine_domtrans',`
|
|
|
|
gen_require(`
|
|
|
|
type wine_t, wine_exec_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
corecmd_search_bin($1)
|
2006-12-12 20:08:08 +00:00
|
|
|
domtrans_pattern($1, wine_exec_t, wine_t)
|
2006-01-19 23:00:23 +00:00
|
|
|
')
|
2007-09-07 13:41:20 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Execute wine in the wine domain, and
|
|
|
|
## allow the specified role the wine domain.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
2010-08-03 15:53:36 +00:00
|
|
|
## Domain allowed to transition.
|
2007-09-07 13:41:20 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
## <param name="role">
|
|
|
|
## <summary>
|
2010-08-03 13:20:22 +00:00
|
|
|
## Role allowed access.
|
2007-09-07 13:41:20 +00:00
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`wine_run',`
|
|
|
|
gen_require(`
|
|
|
|
type wine_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
wine_domtrans($1)
|
|
|
|
role $2 types wine_t;
|
|
|
|
')
|
2010-08-30 15:15:53 +00:00
|
|
|
|
|
|
|
########################################
|
|
|
|
## <summary>
|
|
|
|
## Read and write wine Shared
|
|
|
|
## memory segments.
|
|
|
|
## </summary>
|
|
|
|
## <param name="domain">
|
|
|
|
## <summary>
|
|
|
|
## Domain allowed access.
|
|
|
|
## </summary>
|
|
|
|
## </param>
|
|
|
|
#
|
|
|
|
interface(`wine_rw_shm',`
|
|
|
|
gen_require(`
|
|
|
|
type wine_t;
|
|
|
|
')
|
|
|
|
|
|
|
|
allow $1 wine_t:shm rw_shm_perms;
|
|
|
|
')
|