]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: use new WantsMountsFor= for PrivateTmp=yes and tmp.mount
authorLuca Boccassi <bluca@debian.org>
Mon, 27 Nov 2023 19:34:49 +0000 (19:34 +0000)
committerLuca Boccassi <bluca@debian.org>
Wed, 29 Nov 2023 11:04:59 +0000 (11:04 +0000)
src/core/unit.c

index 252f2c5d2fe3b0542425c639e3bea7e97ec8ce43..aeafb5ae417bdd7e84662e04aa7bdacb7bb4e9c7 100644 (file)
@@ -1331,12 +1331,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
         }
 
         if (c->private_tmp) {
-
-                /* FIXME: for now we make a special case for /tmp and add a weak dependency on
-                 * tmp.mount so /tmp being masked is supported. However there's no reason to treat
-                 * /tmp specifically and masking other mount units should be handled more
-                 * gracefully too, see PR#16894. */
-                r = unit_add_two_dependencies_by_name(u, UNIT_AFTER, UNIT_WANTS, "tmp.mount", true, UNIT_DEPENDENCY_FILE);
+                r = unit_add_mounts_for(u, "/tmp", UNIT_DEPENDENCY_FILE, UNIT_MOUNT_WANTS);
                 if (r < 0)
                         return r;