]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: tighten manager_owns_host_root_cgroup() a bit
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Nov 2018 21:46:03 +0000 (22:46 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Nov 2018 11:24:37 +0000 (12:24 +0100)
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

index 823ed6cd4243f6307ab40ba99138db0641c32a4f..bc676fc69819fc6af12eaabd1e6a81c7de778ad7 100644 (file)
@@ -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;