aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-09-12 22:24:08 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-09-13 05:31:51 +0200
commitef6da157324bfc64a416b7ab419fdc5b9849a8b1 (patch)
treeecb94ac63ebdc9326fbd3a11290d77a4f1142698
parenteed17a47fe8291d449fd505d9a6b1f4a72be8d09 (diff)
downloadpasst-ef6da157324bfc64a416b7ab419fdc5b9849a8b1.tar
passt-ef6da157324bfc64a416b7ab419fdc5b9849a8b1.tar.gz
passt-ef6da157324bfc64a416b7ab419fdc5b9849a8b1.tar.bz2
passt-ef6da157324bfc64a416b7ab419fdc5b9849a8b1.tar.lz
passt-ef6da157324bfc64a416b7ab419fdc5b9849a8b1.tar.xz
passt-ef6da157324bfc64a416b7ab419fdc5b9849a8b1.tar.zst
passt-ef6da157324bfc64a416b7ab419fdc5b9849a8b1.zip
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 <david@gibson.dropbear.id.au>
-rw-r--r--conf.c5
-rw-r--r--passt.12
2 files changed, 0 insertions, 7 deletions
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;
diff --git a/passt.1 b/passt.1
index 88cc879..83395bc 100644
--- a/passt.1
+++ b/passt.1
@@ -453,8 +453,6 @@ Default is \fBauto\fR.
Target user namespace to join, as a path. If PID is given, without this option,
the user namespace will be the one of the corresponding process.
-This option requires --netns or a PID to be specified.
-
.TP
.BR \-\-netns " " \fIspec
Target network namespace to join, as a path or a name. A name is treated as