]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/lxccontainer.c
make lxcapi_get_interfaces and lxcapi_get_ips unprivileged container aware
authorS.Çağlar Onur <caglar@10ur.org>
Tue, 21 Jan 2014 00:57:28 +0000 (19:57 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 22 Jan 2014 01:11:27 +0000 (20:11 -0500)
commitae22a2206489f1a4eba40e26853113772db50929
tree4ee7a672a7125d0040bd8e831589f5b703c72ffa
parentadf4b4083369a8bb7ed3c2ce3dd85dcaed7323c4
make lxcapi_get_interfaces and lxcapi_get_ips unprivileged container aware

Based on Stéphane's suggestion, those two API methods now;

* fork a new process,
* switch to appropriate namespace(s),
* do what we want,
* return the data over a pipe to the parent which returns the result to the original caller.

For the whole thread please see;

 https://lists.linuxcontainers.org/pipermail/lxc-devel/2014-January/007362.html

This patch also makes lxc-ls and lxc-info call those functions.

I'm adding Stéphane as an author here since both the idea as well as
the initial setns code come from him.

Author: S.Çağlar Onur <caglar@10ur.org>
Author: Stéphane Graber <stgraber@ubuntu.com>
Signed-off-by: S.Çağlar Onur <caglar@10ur.org>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc-ls
src/lxc/lxc_info.c
src/lxc/lxccontainer.c