Commit ddaae48b authored by Didier Roche's avatar Didier Roche Committed by Martin Pitt

Avoid /tmp being mounted as tmpfs without the user's will

Ensure PrivateTmp doesn't require tmpfs through tmp.mount, but rather adds
an After relationship.

Closes: #779902
parent cdfabb5e
systemd (215-13) UNRELEASED; urgency=medium
[ Martin Pitt ]
* Add hwclock-save.service to sync the system clock to the hardware clock on
shutdown, to provide monotonic time for reboots. (Note: this is a hack for
jessie; the next Debian release will enable timesyncd by default).
......@@ -9,6 +10,10 @@ systemd (215-13) UNRELEASED; urgency=medium
Christos Trochalakis! (Closes: #779571)
* Fix segfault with units that depend on themselves. (Closes: #780675)
[ Didier Roche ]
* Ensure PrivateTmp doesn't require tmpfs through tmp.mount, but rather adds
an After relationship. (Closes: #779902)
-- Martin Pitt <mpitt@debian.org> Mon, 16 Feb 2015 16:11:12 +0100
systemd (215-12) unstable; urgency=medium
......
From: Didier Roche <didrocks@ubuntu.com>
Date: Wed, 18 Mar 2015 17:11:00 +0100
Subject: PrivateTmp shouldn't require tmpfs
As PrivateTmp is requiring tmp.mount, this one will mount (but only after boot)
/tmp as tmpfs adding a Requires=tmp.mount to the unit. This change downgrades
the requirements to an after relationship.
---
src/core/unit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/core/unit.c b/src/core/unit.c
index 62163b1..536fd5e 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -736,7 +736,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
return 0;
if (c->private_tmp) {
- r = unit_require_mounts_for(u, "/tmp");
+ r = unit_add_dependency_by_name(u, UNIT_AFTER, "tmp.mount", NULL, true);
if (r < 0)
return r;
......@@ -190,3 +190,4 @@ Fix-usr-remount-failure-for-split-usr.patch
Only-start-logind-if-dbus-is-installed.patch
cgroup-don-t-trim-cgroup-trees-created-by-someone-el.patch
core-don-t-fail-to-run-services-in-user-instances-if.patch
PrivateTmp-shouldn-t-require-tmpfs.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment