summaryrefslogtreecommitdiff
path: root/examples/userchroot.py
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-06-16 14:06:59 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-06-16 14:06:59 +0200
commitd205525e1916e8b0fb9cfe95a32794daf514b75f (patch)
tree5c0b21cf6f0af339acd35d73e53ea5db68eeb661 /examples/userchroot.py
parent04b195500fffe982891ae3872c8987bdaeec09c0 (diff)
downloadpython-linuxnamespaces-d205525e1916e8b0fb9cfe95a32794daf514b75f.tar.gz
examples/userchroot.py: correctly bind mount proc and sys
Fixes: be42cb03f861 ("add userchroot.py example")
Diffstat (limited to 'examples/userchroot.py')
-rwxr-xr-xexamples/userchroot.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/userchroot.py b/examples/userchroot.py
index 9c05c6f..2caea33 100755
--- a/examples/userchroot.py
+++ b/examples/userchroot.py
@@ -37,8 +37,8 @@ def main() -> None:
os.setreuid(0, 0)
linuxnamespaces.bind_mount(chrootdir, "/mnt", recursive=True)
- linuxnamespaces.bind_mount(chrootdir / "proc", "/proc", recursive=True)
- linuxnamespaces.bind_mount(chrootdir / "sys", "/sys", recursive=True)
+ linuxnamespaces.bind_mount("/proc", "/mnt/proc", recursive=True)
+ linuxnamespaces.bind_mount("/sys", "/mnt/sys", recursive=True)
linuxnamespaces.populate_dev("/", "/mnt", pidns=False)
os.chdir("/mnt")
linuxnamespaces.pivot_root(".", ".")