wm, 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:49:44 -04:00
parent 7ba794a6a7
commit 77ed833ba2
5 changed files with 27 additions and 18 deletions

View File

@ -12,18 +12,23 @@
## </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.
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <param name="user_domain">
## <summary>
## The type of the user domain.
## 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>
#
@ -41,7 +46,7 @@ template(`wm_role_template',`
type $1_wm_t, wm_domain;
userdom_application_exec_domain($1_wm_t, $1)
userdom_user_application_domain($1_wm_t, wm_exec_t)
role $2 types $1_wm_t;
role $4 types $1_wm_t;
########################################
#
@ -60,8 +65,8 @@ template(`wm_role_template',`
domtrans_pattern($3, wm_exec_t, $1_wm_t)
corecmd_bin_domtrans($1_wm_t, $3)
corecmd_shell_domtrans($1_wm_t, $3)
corecmd_bin_domtrans($1_wm_t, $2)
corecmd_shell_domtrans($1_wm_t, $2)
mls_file_read_all_levels($1_wm_t)
mls_file_write_all_levels($1_wm_t)
@ -71,7 +76,7 @@ template(`wm_role_template',`
auth_use_nsswitch($1_wm_t)
xserver_role($2, $1_wm_t)
xserver_role($1, $1_wm_t, $3, $4)
xserver_manage_core_devices($1_wm_t)
wm_write_pipes($1, $3)
@ -95,12 +100,16 @@ template(`wm_role_template',`
')
optional_policy(`
policykit_run_auth($1_wm_t, $2)
policykit_run_auth($1_wm_t, $4)
policykit_signal_auth($1_wm_t)
')
optional_policy(`
pulseaudio_run($1_wm_t, $2)
pulseaudio_run($1_wm_t, $4)
')
optional_policy(`
systemd_user_app_status($1, $1_wm_t)
')
')

View File

@ -207,6 +207,6 @@ ifndef(`distro_redhat',`
')
optional_policy(`
wm_role_template(staff, staff_r, staff_t)
wm_role_template(staff, staff_t, staff_application_exec_domain, staff_r)
')
')

View File

@ -1262,6 +1262,6 @@ ifndef(`distro_redhat',`
')
optional_policy(`
wm_role_template(sysadm, sysadm_r, sysadm_t)
wm_role_template(sysadm, sysadm_t, sysadm_application_exec_domain, sysadm_r)
')
')

View File

@ -191,6 +191,6 @@ ifndef(`distro_redhat',`
')
optional_policy(`
wm_role_template(user, user_r, user_t)
wm_role_template(user, user_t, user_application_exec_domain, user_r)
')
')

View File

@ -1137,7 +1137,7 @@ template(`userdom_restricted_xwindows_user_template',`
')
optional_policy(`
wm_role_template($1, $1_r, $1_t)
wm_role_template($1, $1_t, $1_application_exec_domain, $1_r)
')
')