From a3566049dc64f0016bc4e1f1e0484e37fb92d373 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sat, 22 Jun 2024 22:08:57 +0200 Subject: populate_dev: fix /dev/net/tun Fixes: 8b98dc846e7b ("populate_dev: remove assumption that newdev does not shadow origdev") --- linuxnamespaces/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linuxnamespaces/__init__.py b/linuxnamespaces/__init__.py index 0af6dee..aff620e 100644 --- a/linuxnamespaces/__init__.py +++ b/linuxnamespaces/__init__.py @@ -446,6 +446,9 @@ def populate_dev( if tun: directories.add("net") files.add("net/tun") + bind_mounts["net/tun"] = exitstack.enter_context( + open_tree(origdev / "net/tun", OpenTreeFlags.OPEN_TREE_CLONE) + ) mount( "devtmpfs", newdev, -- cgit v1.2.3