summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonardo Mörlein2020-05-08 00:58:25 +0000
committerDaniel Golle2020-05-15 18:10:43 +0000
commit7e150f68e666e331e6b970e2ceae1a6a88743bfd (patch)
tree852c1cde5d293c9aad8c3a4861bbd4cbc0e44b21
parent2e738484c5722cf14e1414be66eeb5110bd2834c (diff)
downloadprocd-7e150f68e666e331e6b970e2ceae1a6a88743bfd.tar.gz
jail: unnamed jails can not have netns (fix segfault)
Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
-rw-r--r--jail/jail.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/jail/jail.c b/jail/jail.c
index 67d4cad..a52c264 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -841,6 +841,10 @@ int main(int argc, char **argv)
}
if (opts.namespace & CLONE_NEWNET) {
+ if (!opts.name) {
+ ERROR("netns needs a named jail\n");
+ return -1;
+ }
netns_fd = netns_open_pid(jail_process.pid);
netns_updown(jail_process.pid, true);
}