]> git.ipfire.org Git - thirdparty/lxc.git/commit
tools: replace non-standard namespace identifiers 1312/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 22 Nov 2016 08:42:59 +0000 (09:42 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 22 Nov 2016 16:27:45 +0000 (17:27 +0100)
commit9420e0c2786d7807c259d794544f16370e3213e3
treefd3a14a8c5191571775f72114f3c4f093fb3ffcf
parent7688de67c65dbb0ee70bde3f4e3f0ae301429ffa
tools: replace non-standard namespace identifiers

The identifiers for namespaces used with lxc-unshare and lxc-attach as given on
the manpage do not align with the standard identifiers. This affects network,
mount, and uts namespaces. The standard identifiers are: "mnt", "uts", and
"net" whereas lxc-unshare and lxc-attach use "MOUNT", "UTSNAME", and "NETWORK".
I'm weary to hack this into namespace.{c.h} by e.g. adding additional members
to the ns_info struct or to special case this in lxc_fill_namespace_flags().
Internally, we should only accept standard identifiers to ensure that we are
always correctly aligned with the kernel. So let's use some cheap memmove()s to
replace them by their standard identifiers in lxc-unshare and lxc-attach.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/tools/lxc_attach.c
src/lxc/tools/lxc_unshare.c