From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH v2 21/32] Allow --userns when pasta spawns a command Date: Thu, 08 Sep 2022 16:16:10 +1000 Message-ID: <20220908061621.2430844-22-david@gibson.dropbear.id.au> In-Reply-To: <20220908061621.2430844-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2539433294220296564==" --===============2539433294220296564== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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(-) diff --git a/conf.c b/conf.c index 27d520e..ec191c2 100644 --- a/conf.c +++ b/conf.c @@ -561,11 +561,6 @@ static int conf_pasta_ns(int *netns_only, char *userns, = char *netns, } } =20 - 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 =3D 1; --=20 2.37.3 --===============2539433294220296564==--