From ad413c3165bfe6c5296133473c2aa9c626704f75 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Fri, 17 May 2024 10:51:22 +0200 Subject: populate_dev: also create std{in,out,err} symlinks When booting systemd, it'll create these symlinks, but when doing an application container, nothing does this and we risk creating regular files there. --- linuxnamespaces/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'linuxnamespaces') diff --git a/linuxnamespaces/__init__.py b/linuxnamespaces/__init__.py index e305b4e..54a6883 100644 --- a/linuxnamespaces/__init__.py +++ b/linuxnamespaces/__init__.py @@ -368,7 +368,11 @@ def populate_dev( newdev = AtLocation(newroot) / "dev" directories = {"pts"} files = set() - symlinks = {} + symlinks = { + "stdin": "/proc/self/fd/0", + "stdout": "/proc/self/fd/1", + "stderr": "/proc/self/fd/2", + } bind_mounts: dict[str, AtLocation] = {} with contextlib.ExitStack() as exitstack: for fn in "null zero full random urandom tty".split(): -- cgit v1.2.3