aboutgitcodebugslistschat
path: root/pasta.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-10-14 15:25:30 +1100
committerStefano Brivio <sbrivio@redhat.com>2022-10-15 02:10:36 +0200
commit6909a8e3390913d656f55803fa6cf5d0b1d46812 (patch)
tree3323e3c8a9171bc8d58eb1265fd7836f88c76220 /pasta.c
parent01b4e71f7ad5a4b56d489bcff9bf4e041e540748 (diff)
downloadpasst-6909a8e3390913d656f55803fa6cf5d0b1d46812.tar
passt-6909a8e3390913d656f55803fa6cf5d0b1d46812.tar.gz
passt-6909a8e3390913d656f55803fa6cf5d0b1d46812.tar.bz2
passt-6909a8e3390913d656f55803fa6cf5d0b1d46812.tar.lz
passt-6909a8e3390913d656f55803fa6cf5d0b1d46812.tar.xz
passt-6909a8e3390913d656f55803fa6cf5d0b1d46812.tar.zst
passt-6909a8e3390913d656f55803fa6cf5d0b1d46812.zip
Remove unhelpful drop_caps() call in pasta_start_ns()
drop_caps() has a number of bugs which mean it doesn't do what you'd expect. However, even if we fixed those, the call in pasta_start_ns() doesn't do anything useful: * In the common case, we're UID 0 at this point. In this case drop_caps() doesn't accomplish anything, because even with capabilities dropped, we are still privileged. * When attaching to an existing namespace with --userns or --netns-only we might not be UID 0. In this case it's too early to drop all capabilities: we need at least CAP_NET_ADMIN to configure the tap device in the namespace. Remove this call - we will still drop capabilities a little later in sandbox(). Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'pasta.c')
-rw-r--r--pasta.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/pasta.c b/pasta.c
index cbe0b3a..a6e49eb 100644
--- a/pasta.c
+++ b/pasta.c
@@ -224,8 +224,6 @@ void pasta_start_ns(struct ctx *c, int argc, char *argv[])
exit(EXIT_FAILURE);
}
- drop_caps();
-
NS_CALL(pasta_wait_for_ns, c);
}