podman/pkg/rootless
Paul Holzinger 2a609b0f74
rootless: fix reexec to use /proc/self/exe
Under some circumstances podman might be executed with a different argv0
than the actual path to the podman binary. This breaks the reexec logic
as it tried to exec argv0 which failed.

This is visible when using podmansh as login shell which get's the
special -podmansh on argv0 to signal the shell it is a login shell.

To fix this we can simply use /proc/self/exe as command path which is
much more robust and the argv array is still passed correctly.

Fixes #22672

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-05-14 12:02:19 +02:00
..
rootless.go pkg/rootless: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
rootless_freebsd.c pkg/rootless: Implement rootless.IsFdInherited on FreeBSD 2022-11-15 08:18:41 +00:00
rootless_freebsd.go rootless: drop function ReadMappingsProc 2024-04-10 11:55:35 +02:00
rootless_linux.c rootless: fix reexec to use /proc/self/exe 2024-05-14 12:02:19 +02:00
rootless_linux.go rootless: drop function ReadMappingsProc 2024-04-10 11:55:35 +02:00
rootless_test.go Cease using deprecated runc userlookup 2024-02-02 11:02:43 -05:00
rootless_unsupported.go rootless: drop function ReadMappingsProc 2024-04-10 11:55:35 +02:00