]> git.ipfire.org Git - thirdparty/lxc.git/commit
lxc-attach: Drop privileges when attaching to container unless requested otherwise
authorChristian Seiler <christian@iwakd.de>
Thu, 23 Feb 2012 08:57:14 +0000 (09:57 +0100)
committerDaniel Lezcano <daniel.lezcano@free.fr>
Thu, 23 Feb 2012 08:57:14 +0000 (09:57 +0100)
commitcb014488ee24072579837439389552ce3d6cbb83
tree37e4cd0cc7e4ecc6e061909e9dd8be67f7149a00
parent99d509541d82f247b3225d243fff5359574817ff
lxc-attach: Drop privileges when attaching to container unless requested otherwise

lxc-attach will now put the process that is attached to the container into
the correct cgroups corresponding to the container, set the correct
personality and drop the privileges.

The information is extracted from entries in /proc of the init process of
the container. Note that this relies on the (reasonable) assumption that the
init process does not in fact drop additional capabilities from its bounding
set.

Additionally, 2 command line options are added to lxc-attach: One to prevent
the capabilities from being dropped and the process from being put into the
cgroup (-e, --elevated-privileges) and a second one to explicitly state the
architecture which the process will see, (-a, --arch) which defaults to the
container's current architecture.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/lxc_attach.c