From 7e150f68e666e331e6b970e2ceae1a6a88743bfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leonardo=20M=C3=B6rlein?= Date: Fri, 8 May 2020 02:58:25 +0200 Subject: [PATCH] jail: unnamed jails can not have netns (fix segfault) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Leonardo Mörlein --- jail/jail.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.25.1