On Sun, 11 Sep 2022 18:26:31 +1000 David Gibson <david(a)gibson.dropbear.id.au> wrote:On Sat, Sep 10, 2022 at 05:25:36PM +1000, David Gibson wrote:Right, thanks for noticing, that combination didn't occur to me at all. -- StefanoOn Fri, Sep 09, 2022 at 04:34:20PM +0200, Stefano Brivio wrote:Actually, I realized there is a reason to leave it in: just using --netns doesn't work with spawning a command, and spawning a command with netns but no userns might be useful.On Thu, 8 Sep 2022 13:59:05 +1000 David Gibson <david(a)gibson.dropbear.id.au> wrote:Well.. having reduced the lifetome of netns_only to within conf() alone, I felt a lot less urgency about removing it entirely. It might still be nicer to remove it anyway; I'll have another look.--netns-only is supposed to make pasta use only a network namespace, not a user namespace. However, pasta_start_ns() has this backwards, and if --netns-only is specified it creates a user namespace but *not* a network namespace. Correct this. Signed-off-by: David Gibson <david(a)gibson.dropbear.id.au> --- pasta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pasta.c b/pasta.c index 0fd45e4..7eac8e9 100644 --- a/pasta.c +++ b/pasta.c @@ -244,8 +244,8 @@ void pasta_start_ns(struct ctx *c, int argc, char *argv[]) pasta_child_pid = clone(pasta_setup_ns, ns_fn_stack + sizeof(ns_fn_stack) / 2, - (c->netns_only ? 0 : CLONE_NEWNET) | - CLONE_NEWIPC | CLONE_NEWPID | CLONE_NEWUSER | + (c->netns_only ? 0 : CLONE_NEWUSER) | + CLONE_NEWIPC | CLONE_NEWPID | CLONE_NEWNET |Oh, funny, so it never worked in this case. I thought anyway your plan was to drop --netns-only altogether, and if a --netns option is specified without --userns, then it's implied. Is that still on the table (outside the scope of this series I presume)?