libmtp, 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:02:14 -04:00
parent 0f650e0dc5
commit 8bdab0397c
4 changed files with 26 additions and 11 deletions

View File

@ -4,27 +4,42 @@
## <summary>
## Role access for libmtp.
## </summary>
## <param name="role">
## <param name="role_prefix">
## <summary>
## Role allowed access.
## The prefix of the user role (e.g., user
## is the prefix for user_r).
## </summary>
## </param>
## <param name="domain">
## <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>
#
interface(`libmtp_role',`
template(`libmtp_role',`
gen_require(`
attribute_role libmtp_roles;
type libmtp_t, libmtp_exec_t;
')
roleattribute $1 libmtp_roles;
roleattribute $4 libmtp_roles;
domtrans_pattern($2, libmtp_exec_t, libmtp_t)
domtrans_pattern($3, libmtp_exec_t, libmtp_t)
allow $2 libmtp_t:process { ptrace signal_perms };
ps_process_pattern($2, libmtp_t)
allow $3 libmtp_t:process { ptrace signal_perms };
ps_process_pattern($3, libmtp_t)
optional_policy(`
systemd_user_app_status($1, libmtp_t)
')
')

View File

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

View File

@ -543,7 +543,7 @@ optional_policy(`
')
optional_policy(`
libmtp_role(sysadm_r, sysadm_t)
libmtp_role(sysadm, sysadm_t, sysadm_application_exec_domain, sysadm_r)
')
optional_policy(`

View File

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