]> git.ipfire.org Git - thirdparty/lxc.git/commit
cgmanager: several fixes
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 8 Oct 2014 05:14:26 +0000 (00:14 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 25 Nov 2014 21:48:30 +0000 (16:48 -0500)
commitc6234a0afed9e064fd9a8235874f893194796c2d
tree6f84732f192ff4271af1c868384bb5d27a9e48af
parent8ac62e20feb226f08ef04d8a43930e5eb6cc9417
cgmanager: several fixes

These all fix various ways that cgroup actions could fail if an
unprivileged user's cgroup paths were not all the same for all
controllers.

1. in cgm_{g,s}et, use the right controller, not the first in the list,
   to get the cgroup path.

2. when we pass 'all' to cgmanager for a ${METHOD}_abs, make sure that all
   cgroup paths are the same.  That isn't necessary for methods not
   taking an absolute path, so split up the former
   cgm_supports_multiple_controllers() function into two booleans, one
   telling whether cgm supports it, and another telling us whether
   cgm supports it AND all controller cgroup paths are the same.

3. separately, do_cgm_enter with abs=true couldn't work if all
   cgroup paths were not the same.  So just ditch that helper and
   call lxc_cgmanager_enter() where needed, because the special
   cases would be more complicated.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/cgmanager.c