summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2024-05-25 10:35:49 +0200
committerHelmut Grohne <helmut@subdivi.de>2024-05-25 10:35:49 +0200
commit0256e324c7befaf5e3ec43fb5ac7af6aca220225 (patch)
tree81d1162975dbf995c11e92393fabf7095c6a9259 /examples
parentc5c9fe325782a790d563a0a8b1cf62a855a50d81 (diff)
downloadpython-linuxnamespaces-0256e324c7befaf5e3ec43fb5ac7af6aca220225.tar.gz
examples/chrootfuse.py: fix file descriptor leak
Fixes: f01c7690de8e ("add example chrootfuse2fs.py")
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/chrootfuse.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/chrootfuse.py b/examples/chrootfuse.py
index ef67e8a..93a9da0 100755
--- a/examples/chrootfuse.py
+++ b/examples/chrootfuse.py
@@ -50,6 +50,7 @@ def main() -> None:
"squashfs": "squashfuse",
}[args.fstype]
os.execlp(driver, driver, str(args.fsimage), "/dev/fd/%d" % fds[0])
+ childsock.close()
linuxnamespaces.unshare(
linuxnamespaces.CloneFlags.NEWUSER | linuxnamespaces.CloneFlags.NEWNS
)