]> git.ipfire.org Git - thirdparty/lxc.git/commit
attach: Support unprivileged containers
authorStéphane Graber <stgraber@ubuntu.com>
Mon, 20 Jan 2014 20:26:15 +0000 (15:26 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Tue, 21 Jan 2014 04:10:24 +0000 (23:10 -0500)
commitf4364484454c754ed905bfb85bd2727a0a5d0475
treeb4d3e022d9534b0ef9ff7ab3a69197fd22b77cd7
parentdbfa71289dd3b2196cb63f399505bc62bcaf5f4e
attach: Support unprivileged containers

This change makes lxc-attach and the matching API functions work
properly with unprivileged containers.

The trick needed to make that possible was to always start with the
userns when attaching and also relocate the cgroup management code so
that the intermediate process is moved to the cgroup before attaching to
the container's namespace as doing so later would fail due to missing
permissions.

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/attach.c
src/lxc/lxc_attach.c
src/lxc/lxccontainer.c