]> git.ipfire.org Git - thirdparty/lxc.git/commit
better unprivileged detection
authorTycho Andersen <tycho@tycho.ws>
Fri, 26 Jan 2018 21:21:51 +0000 (21:21 +0000)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 7 Feb 2018 11:31:57 +0000 (12:31 +0100)
commit0dfed0f902b9bc0df7518d32c217f89696de4d4b
treeb0e8a9120e8fa5634516074801d612e733e1eb58
parent02b05b04bbd65d31086ad530bb5cd7c2e98751fa
better unprivileged detection

In particular, if we are already in a user namespace we are unprivileged,
and doing things like moving the physical nics back to the host netns won't
work. Let's do the same thing LXD does if euid == 0: inspect
/proc/self/uid_map and see what that says.

Signed-off-by: Tycho Andersen <tycho@tycho.ws>
src/lxc/utils.h