core: make mount(8) and swapon(8) inherit SMACK label from systemd

By default mount(8), umount(8), swapon(8) and swapoff(8) should run with
with the SMACK label inherited from systemd rather than the default one
meant for services.

Fixes: aa5ae9711e
Follow-up-for: 20bbf5ee4c
This commit is contained in:
Łukasz Stelmach
2024-10-30 17:41:23 +01:00
committed by Lennart Poettering
parent 58ada3eab2
commit 8144537a81
2 changed files with 6 additions and 0 deletions
+3
View File
@@ -876,6 +876,9 @@ static int mount_spawn(Mount *m, ExecCommand *c, PidRef *ret_pid) {
if (r < 0)
return r;
/* Assume the label inherited from systemd as the fallback */
exec_params.fallback_smack_process_label = NULL;
r = exec_spawn(UNIT(m),
c,
&m->exec_context,
+3
View File
@@ -642,6 +642,9 @@ static int swap_spawn(Swap *s, ExecCommand *c, PidRef *ret_pid) {
if (r < 0)
return r;
/* Assume the label inherited from systemd as the fallback */
exec_params.fallback_smack_process_label = NULL;
r = exec_spawn(UNIT(s),
c,
&s->exec_context,