Skip to content

Commit

Permalink
Allow init create /var/cache/systemd/home
Browse files Browse the repository at this point in the history
  • Loading branch information
zpytela committed Oct 15, 2024
1 parent c360d2c commit e9f631a
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
1 change: 1 addition & 0 deletions policy/modules/system/init.te
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,7 @@ optional_policy(`
')

optional_policy(`
systemd_homed_cache_filetrans(init_t)
systemd_homed_dbus_chat(init_t)
systemd_homed_write_pipes(init_t)
')
Expand Down
20 changes: 20 additions & 0 deletions policy/modules/system/systemd-homed.if
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,23 @@ interface(`systemd_homed_write_pipes',`
write_fifo_files_pattern($1, systemd_homed_runtime_dir_t, systemd_homed_runtime_pipe_t)
')

########################################
## <summary>
## Create /var/cache/systemd/home
## with a private type using a type_transition.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`systemd_homed_cache_filetrans',`
gen_require(`
type systemd_homed_cache_t;
')

optional_policy(`
systemd_cache_filetrans($1, systemd_homed_cache_t, dir, home)
')
')
34 changes: 34 additions & 0 deletions policy/modules/system/systemd.if
Original file line number Diff line number Diff line change
Expand Up @@ -3081,3 +3081,37 @@ interface(`systemd_nsresourced_prog_run_bpf',`

allow $1 systemd_nsresourced_t:bpf { map_read map_write prog_run };
')

########################################
## <summary>
## Create objects in /var/cache/systemd
## with a private type using a type_transition.
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
## <param name="file_type">
## <summary>
## Private file type.
## </summary>
## </param>
## <param name="class">
## <summary>
## Object classes to be created.
## </summary>
## </param>
## <param name="name" optional="true">
## <summary>
## The name of the object being created.
## </summary>
## </param>
#
interface(`systemd_cache_filetrans',`
gen_require(`
type systemd_cache_t;
')

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

0 comments on commit e9f631a

Please sign in to comment.