ryantimwilson / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
1abbee
From 14eaa63230a16a32f49db74d4b0d78247874ccdd Mon Sep 17 00:00:00 2001
4e2e74
From: Didier Roche <didrocks@ubuntu.com>
4e2e74
Date: Wed, 13 Jan 2016 12:49:57 +0100
4e2e74
Subject: [PATCH] Avoid /tmp being mounted as tmpfs without the user's will
4e2e74
4e2e74
Ensure PrivateTmp doesn't require tmpfs through tmp.mount, but rather
4e2e74
adds an After relationship.
4e2e74
4e2e74
rhel-only
4e2e74
4e2e74
Resolves: #1298109
4e2e74
---
4e2e74
 src/core/unit.c | 2 +-
4e2e74
 1 file changed, 1 insertion(+), 1 deletion(-)
4e2e74
4e2e74
diff --git a/src/core/unit.c b/src/core/unit.c
4e2e74
index ae47a28..4fb2fd3 100644
4e2e74
--- a/src/core/unit.c
4e2e74
+++ b/src/core/unit.c
4e2e74
@@ -807,7 +807,7 @@ int unit_add_exec_dependencies(Unit *u, ExecContext *c) {
4e2e74
                 return 0;
4e2e74
 
4e2e74
         if (c->private_tmp) {
4e2e74
-                r = unit_require_mounts_for(u, "/tmp");
4e2e74
+                r = unit_add_dependency_by_name(u, UNIT_AFTER, "tmp.mount", NULL, true);
4e2e74
                 if (r < 0)
4e2e74
                         return r;
4e2e74