]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: make mount(8) and swapon(8) inherit SMACK label from systemd
authorŁukasz Stelmach <l.stelmach@samsung.com>
Tue, 29 Oct 2024 14:53:45 +0000 (15:53 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 30 Oct 2024 16:41:23 +0000 (17:41 +0100)
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: aa5ae9711ef3cd0c69b7fcfbd65bca05fb704a8a
Follow-up-for: 20bbf5ee4c6c80599a91e7a4b7474e931a27db4a

src/core/mount.c
src/core/swap.c

index 19dd09c58fddecefc88d5e3f7bab755c9a2a2eba..92e0d7737a7a0ab12ce72d6e0985ca3d8affe73e 100644 (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,
index ff6c4255ab70bef353a1b95ba6adb8bdcf5c234d..312db05db57caaf635df4eff4c3540fba867ae98 100644 (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,