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