From 628d2ad4bf886ee792b6ea91f52aed708dae8702 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 31 Jul 2016 20:39:18 +0200 Subject: Adding support for user namespace. Signed-off-by: Daniel Baumann --- lib/container/create | 1 + lib/container/start | 12 ++++++++++++ share/config/container.conf.in | 1 + 3 files changed, 14 insertions(+) diff --git a/lib/container/create b/lib/container/create index 2d66436..cb51871 100755 --- a/lib/container/create +++ b/lib/container/create @@ -188,6 +188,7 @@ sed -e "s|@CNT_AUTO@|${CNT_AUTO}|g" \ -e "s|@LINK_JOURNAL@|no|g" \ -e "s|@MACHINE@|${NAME}|g" \ -e "s|@NETWORK_VETH_EXTRA@|${NETWORK_VETH_EXTRA}|g" \ + -e "s|@PRIVATE_USERS@|no|g" \ -e "s|@REGISTER@|yes|g" \ /usr/share/container-tools/config/container.conf.in > "${CONFIG}/${NAME}.conf" diff --git a/lib/container/start b/lib/container/start index 41e8f72..5191ae2 100755 --- a/lib/container/start +++ b/lib/container/start @@ -312,6 +312,18 @@ EOF ;; esac + PRIVATE_USERS="$(awk -F= '/^private-users=/ { print $2 }' ${CONFIG}/${NAME}.conf || echo no)" + + case "${PRIVATE_USERS}" in + yes) + PRIVATE_USERS="--private-users=yes" + ;; + + *) + PRIVATE_USERS="--private-users=no" + ;; + esac + REGISTER="$(awk -F= '/^register=/ { print $2 }' ${CONFIG}/${NAME}.conf || echo yes)" case "${REGISTER}" in diff --git a/share/config/container.conf.in b/share/config/container.conf.in index 5a0b7cf..b5678c0 100644 --- a/share/config/container.conf.in +++ b/share/config/container.conf.in @@ -12,6 +12,7 @@ drop-capability=@DROP_CAPABILITY@ link-journal=@LINK_JOURNAL@ machine=@MACHINE@ network-veth-extra=@NETWORK_VETH_EXTRA@ +private-users=@PRIVATE_USERS@ register=@REGISTER@ [limit] -- cgit v1.2.3