Skip to content

Commit aff164f

Browse files
committed
label /run/sysctl.d correctly on creation
As part of a netavark bug[1] fix I must create /run/sysctl.d to write some config files there for systemd. However in order for them to be able to get read by systemd-sysctl they must have the system_conf_t context. As I don't want to add a manual relabel in netavark add a selinux file transition rule here because netavark runs as container_runtime_t. [1] containers/netavark#1245 Signed-off-by: Paul Holzinger <[email protected]>
1 parent d7e420a commit aff164f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

container.te

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ policy_module(container, 2.237.0)
22

33
gen_require(`
44
class passwd rootok;
5+
type system_conf_t;
56
')
67

78
########################################
@@ -1626,3 +1627,7 @@ tunable_policy(`deny_ptrace',`',`
16261627
allow container_domain self:process ptrace;
16271628
allow spc_t self:process ptrace;
16281629
')
1630+
1631+
# netavark needs to write to /run/sysctl.d and needs the right label for systemd to read it.
1632+
# https://issues.redhat.com/browse/RHEL-91380
1633+
files_pid_filetrans(container_runtime_t, system_conf_t, dir, "sysctl.d")

0 commit comments

Comments
 (0)