summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Golle2020-11-26 16:24:47 +0000
committerDaniel Golle2020-11-27 01:06:09 +0000
commitb275b11d89beff3664d0c30b07e8d83b6098be71 (patch)
treeaef4890ce2a21c309a3dc4be31c3aa51bce8ad39
parentb87984baf3f4bdfb61b3b38bb4b2dfebeb91b6b9 (diff)
downloadprocd-b275b11d89beff3664d0c30b07e8d83b6098be71.tar.gz
jail: enter existing cgroups namespace if given
Call to enter an existing cgroups namespace was missing. Add it. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--jail/jail.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/jail/jail.c b/jail/jail.c
index 80da47f..7ec6cd8 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -1129,6 +1129,8 @@ static int exec_jail(void *arg)
if (opts.namespace & CLONE_NEWCGROUP)
unshare(CLONE_NEWCGROUP);
+ setns_open(CLONE_NEWCGROUP);
+
if ((opts.namespace & CLONE_NEWUSER) || (opts.setns.user != -1)) {
if (setregid(0, 0) < 0) {
ERROR("setgid\n");