-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Groups for root user not applied during podman exec when no explicit user specified #25610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I tried it out on Fedor 8000 a CoreOS 43.20250211.91.0. docker produces the expected result
but podman doesn't
|
it seems to be caused by this condition: https://github.com/containers/podman/blob/main/libpod/oci_conmon_exec_common.go#L732 I don't understand it, @mheon why do we ignore |
Commit introducing is #5349 which seems to be aimed at fixing a very similar bug to what was reported here - though I suspect you meant to point at the next line, which goes back even further, to the original introduction of our Conmon-based exec code in #3143 - so the condition appears to have originally been added by Peter around 6 years ago as part of our conversion to Conmon for exec? It looks like it was originally intended that it be unconditional so long as we actually had an execUser but a half-dozen refactorings made that no longer the case. Anyways, this is a long-winded way of saying that I don't think there is a good reason and it's probably safe to change. |
Issue Description
Under certain conditions - specifically when the container relies on an implicit root user for each step - the Linux groups added to the root user in the Dockerfile do not apply to an interactive shell session started with podman exec -it ... /bin/sh. This issue also impacts any groups defined in the base image.
I am only able to reproduce this issue when the following conditions are met:
Note: As soon as I add --user or the USER directive at any step I cannot reproduce this issue anymore.
Steps to reproduce the issue
Steps to reproduce the issue
Describe the results you received
Describe the results you expected
podman info output
Podman in a container
No
Privileged Or Rootless
None
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: