Commit d305828
committed
systemd: allow tmpfiles to relabel various unlabeled objects
For example, I have `/var/tmp/portage` on zram. On startup, zram-generator
mounts it, and later, systemd-tmpfiles processes a (pre-existing) tmpfiles.d
entry to create `/var/tmp/portage`. We need a way to keep the context.
Allow tmpfiles to relabel for these cases:
```
AVC avc: denied { getattr } for pid=1439 comm="systemd-tmpfile" path="/var/tmp/portage" dev="zram0" ino=128
scontext=system_u:system_r:systemd_tmpfiles_t:s0
tcontext=system_u:object_r:unlabeled_t:s0
tclass=dir
AVC avc: denied { setattr } for pid=1439 comm="systemd-tmpfile" name="/" dev="zram0" ino=128
scontext=system_u:system_r:systemd_tmpfiles_t:s0
tcontext=system_u:object_r:unlabeled_t:s0
tclass=dir
AVC avc: denied { relabelfrom } for pid=1439 comm="systemd-tmpfile" name="/" dev="zram0" ino=128
scontext=system_u:system_r:systemd_tmpfiles_t:s0
tcontext=system_u:object_r:unlabeled_t:s0
tclass=dir
```
Signed-off-by: Sam James <sam@gentoo.org>1 parent 01f6bb2 commit d305828
1 file changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2234 | 2234 | | |
2235 | 2235 | | |
2236 | 2236 | | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
2237 | 2245 | | |
2238 | 2246 | | |
2239 | 2247 | | |
| |||
0 commit comments