Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libnetwork/rootlessnetns: do not use rootless-netns when not re-exec
The IsRootless() check is dangerous in a sense that it may not do what you think it does. It also returns true even when podman is run as root and not in the podman userns but as part of a different userns. Could be a other container manager that configured the userns. This results in us doing the rootless-netns logic even when we should not need to. To fix this we now check for the _CONTAINERS_USERNS_CONFIGURED env var to make sure we are not re-exe'ed. This is what we actually care about. This is a regression compared to podman 4.X, because the code was moved into c/common the IsRootless() check was changed to the c/storage version which has the userns special case. Fixes containers/podman#22218 Signed-off-by: Paul Holzinger <[email protected]>
- Loading branch information