mplayer, roles: use user exec domain attribute

Signed-off-by: Kenton Groombridge <me@concord.sh>
This commit is contained in:
Kenton Groombridge 2021-08-08 12:09:56 -04:00
parent f5f0af2c24
commit ffdbf9c86e
4 changed files with 31 additions and 15 deletions

View File

@ -4,18 +4,29 @@
## <summary>
## Role access for mplayer
## </summary>
## <param name="role_prefix">
## <summary>
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <param name="user_domain">
## <summary>
## User domain for the role.
## </summary>
## </param>
## <param name="user_exec_domain">
## <summary>
## User exec domain for execute and transition access.
## </summary>
## </param>
## <param name="role">
## <summary>
## Role allowed access
## </summary>
## </param>
## <param name="domain">
## <summary>
## User domain for the role
## </summary>
## </param>
#
interface(`mplayer_role',`
template(`mplayer_role',`
gen_require(`
attribute_role mencoder_roles, mplayer_roles;
type mencoder_t, mencoder_exec_t, mplayer_home_t;
@ -27,19 +38,19 @@ interface(`mplayer_role',`
# Declarations
#
roleattribute $1 mencoder_roles;
roleattribute $1 mplayer_roles;
roleattribute $4 mencoder_roles;
roleattribute $4 mplayer_roles;
########################################
#
# Policy
#
domtrans_pattern($2, mencoder_exec_t, mencoder_t)
domtrans_pattern($2, mplayer_exec_t, mplayer_t)
domtrans_pattern($3, mencoder_exec_t, mencoder_t)
domtrans_pattern($3, mplayer_exec_t, mplayer_t)
allow $2 { mplayer_t mencoder_t }:process { getsched ptrace signal_perms };
ps_process_pattern($2, { mplayer_t mencoder_t })
allow $3 { mplayer_t mencoder_t }:process { getsched ptrace signal_perms };
ps_process_pattern($3, { mplayer_t mencoder_t })
allow $2 mplayer_home_t:dir { manage_dir_perms relabel_dir_perms };
allow $2 mplayer_home_t:file { manage_file_perms relabel_file_perms };
@ -50,6 +61,11 @@ interface(`mplayer_role',`
allow $2 mplayer_tmpfs_t:lnk_file { manage_lnk_file_perms relabel_lnk_file_perms };
allow $2 mplayer_tmpfs_t:fifo_file { manage_fifo_file_perms relabel_fifo_file_perms };
allow $2 mplayer_tmpfs_t:sock_file { manage_sock_file_perms relabel_sock_file_perms };
optional_policy(`
systemd_user_app_status($1, mencoder_t)
systemd_user_app_status($1, mplayer_t)
')
')
########################################

View File

@ -139,7 +139,7 @@ ifndef(`distro_redhat',`
')
optional_policy(`
mplayer_role(staff_r, staff_t)
mplayer_role(staff, staff_t, staff_application_exec_domain, staff_r)
')
optional_policy(`

View File

@ -633,7 +633,7 @@ optional_policy(`
')
optional_policy(`
mplayer_role(sysadm_r, sysadm_t)
mplayer_role(sysadm, sysadm_t, sysadm_application_exec_domain, sysadm_r)
')
optional_policy(`

View File

@ -107,7 +107,7 @@ ifndef(`distro_redhat',`
')
optional_policy(`
mplayer_role(user_r, user_t)
mplayer_role(user, user_t, user_application_exec_domain, user_r)
')
optional_policy(`