-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Non root user in docker.io/eclipse-mosquitto container cannot write to any directory under podman 2.0.2 #6989
Comments
Your reproducer worked fine for me. |
|
Hm. It (reproducibly) does not work for me on two different machines. I'm at a bit of a loss on how to debug this. |
Could you try it privileged? Did you try this as non root? |
One curios think from your example above is that -rw-r--r-- 1 0 0 33 Jul 15 19:05 mosquitto.conf mosquitto.conf should have some size? |
I did run all of this as root (using sudo from my normal user account). I could try this from a "real" root shell if you think that will make any difference? The file size is 33, those 0's are the uid and gid. |
OK, using podman 2.0.2, running under a shell spawned by "sudo su -" does work. Running the same podman command using "sudo" from my user shell directly does not work. |
If you change your umask does it work? |
It does.
|
$ umask 0077 Strange since it seems the container runtime switches the unmask inside of the container, but that probably happens after the image is setup. |
I wonder if podman should force the umask to 0022 when it starts up, to avoid this kind of issue. |
I have to admit that finding out that it's the umask that triggers the behaviour has done little to clear up my understanding of what the exact mechanism of failure is. The writes in the test case don't go to a permanent storage, they disappear when the container is stopped. They go to some sort of temporary overlay, I assume? |
yes the OCI runtime forces the mask to 0022 (if not configured differently), but podman doesn't. I remember adding the umask check at some point to podman, it probably got lost with the migration to 2.0 |
yes it is a regression introduced by 241326a. It drops the call to setUMask |
PR here: #7005 |
the code got lost in the migration to podman 2.0, reintroduce it. Closes: containers#6989 Signed-off-by: Giuseppe Scrivano <[email protected]>
the code got lost in the migration to podman 2.0, reintroduce it. Closes: containers#6989 Signed-off-by: Giuseppe Scrivano <[email protected]> <MH: Fixed build> Signed-off-by: Matthew Heon <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
The docker.io/eclipse-mosquitto container contains a binary that drops privileges to UID/GID 1883. When run under podman 2.0.2 that user is not anle to write to any file/directory, regardless of permissions. When run under podman 1.8.2 things work.
Steps to reproduce the issue:
podman 2.0.2:
podman 1.8.2:
Describe the results you received:
Writing files as the 1883 user inside the container fails even in locations that should succeed under 2.0.2
Describe the results you expected:
Same as under 1.8.2, the write should succeed.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:1.8.2:
2.0.2:
Output of
podman info --debug
:2.0.2:
Package info (e.g. output of
rpm -q podman
orapt list podman
):1.8.2:
2.0.2:
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: