From ef6da157324bfc64a416b7ab419fdc5b9849a8b1 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Mon, 12 Sep 2022 22:24:08 +1000 Subject: Allow --userns when pasta spawns a command Currently --userns is only allowed when pasta is attaching to an existing netns or PID, and is prohibited when creating a new netns by spawning a command or shell. With the new handling of userns, this check isn't neccessary. I'm not sure if there's any use case for --userns with a spawned command, but it's strictly more flexible and requires zero extra code, so we might as well. Signed-off-by: David Gibson --- conf.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'conf.c') diff --git a/conf.c b/conf.c index 7f32859..d80233c 100644 --- a/conf.c +++ b/conf.c @@ -561,11 +561,6 @@ static int conf_pasta_ns(int *netns_only, char *userns, char *netns, } } - if (*userns && !*netns) { - err("--userns requires --netns or PID"); - return -EINVAL; - } - /* Attaching to a netns/PID, with no userns given */ if (*netns && !*userns) *netns_only = 1; -- cgit v1.2.3