From 97eada134e410a83cd024a490721dec27f45d097 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sat, 22 Jun 2024 22:20:59 +0200 Subject: unschroot: only provide /dev/net/tun when the network namespace is unshared --- examples/unschroot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/unschroot.py b/examples/unschroot.py index cbabcc4..59c0ce4 100755 --- a/examples/unschroot.py +++ b/examples/unschroot.py @@ -245,7 +245,9 @@ def do_run_session(args: argparse.Namespace) -> None: os.chdir("/mnt") linuxnamespaces.populate_sys("/", ".") linuxnamespaces.populate_proc("/", ".", ns) - linuxnamespaces.populate_dev("/", ".") + linuxnamespaces.populate_dev( + "/", ".", tun=bool(ns & linuxnamespaces.CloneFlags.NEWNET) + ) linuxnamespaces.pivot_root(".", ".") linuxnamespaces.umount(".", linuxnamespaces.UmountFlags.DETACH) os.chdir("/") -- cgit v1.2.3