From 28cfdc5aebc044c82b6716fa1fedf847c060d043 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 20 Nov 2018 22:46:03 +0100 Subject: [PATCH] cgroup: tighten manager_owns_host_root_cgroup() a bit This tightening is not strictly necessary (as the m->cgroup_root check further down does the same), but let's make this explicit. --- src/core/cgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/cgroup.c b/src/core/cgroup.c index 823ed6cd424..bc676fc6981 100644 --- a/src/core/cgroup.c +++ b/src/core/cgroup.c @@ -39,6 +39,9 @@ bool manager_owns_host_root_cgroup(Manager *m) { * appears to be no nice way to detect whether we are in a CLONE_NEWCGROUP namespace we instead just check if * we run in any kind of container virtualization. */ + if (MANAGER_IS_USER(m)) + return false; + if (detect_container() > 0) return false;