]> git.proxmox.com Git - mirror_lxc.git/commit - configure.ac
cgmanager: use absolute cgroup path to switch cgroups at attach
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 1 May 2014 20:27:55 +0000 (15:27 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 7 May 2014 03:54:39 +0000 (22:54 -0500)
commit25c7531cf0bab45e06fb2ebf05ce2f37c5c0f649
tree6eef2f88ea2fdf44787ed28c20dd0c634a3bdeb2
parentcbf0bae67ca5c285c8770d893dfa1924eb5abfe9
cgmanager: use absolute cgroup path to switch cgroups at attach

If an unprivileged user does 'lxc-start -n u1' in one
login session, followed by 'lxc-attach -n u1' in another
session, the attach will fail if the sessions are in different
cgroups.  The same is true of lxc-cgroup commands.

Address this by using the GetPidCgroupAbs and MovePidAbs
which work with the containers' cgroup path relative to
the cgproxy.

Since GetPidCgroupAbs is new to api version 3 in cgmanager,
use the old method if we are on an older cgmanager.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Tested-by: "S.Çağlar Onur" <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
configure.ac
src/lxc/cgmanager.c