summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-06-22 22:08:57 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-06-22 22:08:57 +0200
commita3566049dc64f0016bc4e1f1e0484e37fb92d373 (patch)
tree08d731c5881ce7d7e6389fe85ab9084f5cb2a384
parent99932b7bd7d312449877d26ac39ca8e88f7b81b0 (diff)
downloadpython-linuxnamespaces-a3566049dc64f0016bc4e1f1e0484e37fb92d373.tar.gz
populate_dev: fix /dev/net/tun
Fixes: 8b98dc846e7b ("populate_dev: remove assumption that newdev does not shadow origdev")
-rw-r--r--linuxnamespaces/__init__.py3
1 files changed, 3 insertions, 0 deletions
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,