Skip to content

Commit

Permalink
Allow virtnodedev create /etc/mdevctl.d/scripts.d with bin_t type
Browse files Browse the repository at this point in the history
  • Loading branch information
zpytela committed Jan 16, 2025
1 parent a49d7cf commit 1e00f00
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions policy/modules/contrib/virt.te
Original file line number Diff line number Diff line change
Expand Up @@ -2016,6 +2016,7 @@ dev_write_sysfs_dirs(virtnodedevd_t)

files_map_var_lib_files(virtnodedevd_t)
files_etc_filetrans_mdevctl_conf(virtnodedevd_t)
files_etc_filetrans_mdevctl_conf_scripts(virtnodedevd_t)
files_manage_mdevctl_conf_files(virtnodedevd_t)
files_watch_mdevctl_conf_dirs(virtnodedevd_t)

Expand Down
33 changes: 33 additions & 0 deletions policy/modules/kernel/corecommands.if
Original file line number Diff line number Diff line change
Expand Up @@ -1235,3 +1235,36 @@ interface(`corecmd_bin_filetrans',`

filetrans_pattern($1, bin_t, $2, $3, $4)
')

########################################
## <summary>
## Create objects with the bin_t type
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="file_type">
## <summary>
## The type of the object to be created
## </summary>
## </param>
## <param name="object_class">
## <summary>
## The object class.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
#
interface(`corecmd_bin_filetrans_to',`
gen_require(`
type bin_t;
')

filetrans_pattern($1, $2, bin_t, $3, $4)
')
18 changes: 18 additions & 0 deletions policy/modules/kernel/files.if
Original file line number Diff line number Diff line change
Expand Up @@ -6139,6 +6139,24 @@ interface(`files_etc_filetrans_mdevctl_conf',`
filetrans_pattern($1, etc_t, mdevctl_conf_t, dir, "mdevctl.d")
')

###################################
## <summary>
## Create /etc/mdevctl.d/scripts.d with the bin_t type
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`files_etc_filetrans_mdevctl_conf_scripts',`
gen_require(`
type mdevctl_conf_t;
')

corecmd_bin_filetrans_to($1, mdevctl_conf_t, dir, "scripts.d")
')

#######################################
## <summary>
## Read manageable system configuration files in /etc
Expand Down

0 comments on commit 1e00f00

Please sign in to comment.