-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Permissions in docker images are lost during gitpod restore #3174
Comments
Thanks for the report @shaal! Sorry if the answer is obvious, but how does changing the setuid bit affects your work when using Gitpod? I'm not saying it isn't a bug, just thinking about prioritization... 🤔 |
Sorry, I tried being specific and wanted to show the simplest way to reproduce the bug. The way it affects my work, is that when a workspace times out, I can no longer work on that workspace again, until I destroy all docker containers. You can see an example project here - It opens one terminal with Now stop the workspace (or wait for it to timeout) You'll see in the 3rd terminal, the command
Running
|
The fundamental problem is that several of the images used for ddev have sudo in them, and of course sudo is not usable with the setuid bit reset inappropriately. I'm sure there are other utilities that would be hobbled with the setuid inappropriately reset, but sudo is the big one. When a workspace is awakened, the setuid bit is no longer set on sudo inside these images. It should not have been changed. And it doesn't matter if you re-pull the image. Same result. |
Thank you for reporting this. This look like an issue with the content init during workspace startup. Apparently we're not preserving file modes correctly in some cases. |
I'm obviously a novice to the codebase, but a common way to lose setuid bits and ownership information is to run
|
This problem is actually not just about setuid, but about permissions in general. In a docker image that had a directory with permissions 0777 (/etc/alternatives), after restore it has 0755 privileges. @shaal maybe you can update the title to add "different permissions entirely" |
I put together a repro case for the loss of permissions. It shows that both files and directories inside a docker image have their permissions changed (lost) during a gitpod restore. Please see https://github.com/rfay/gitpod-bug-repro or go straight to https://gitpod.io/#https://github.com/rfay/gitpod-bug-repro - it's easy to follow and recreate, and shows at least 3 cases of lost permissions, not just setuid (as was the OP here) but also directory and file permissions of 777 get cut back to 755. |
@rfay thank you for the repository reproducing the issue. |
@aledbf @csweichel is it possible to re-open this issue? I think the bug is not resolved yet. The new Gitpod , does restore the workspace with the correct file permissions, but the owner of the files is I forked @rfay repo, and added a You can run the command manually, according to the Readme of that repo to see the same issue. The result after workspace restore: (where file owner should be
|
@aledbf Unfortunately, I cannot test it until I get have access to a working build of that PR. |
UPDATE:
This problem is actually not just about setuid, but about permissions in general.
Follow this comment #3174 (comment) for an even simpler steps to reproduce the issue.
Describe the bug
In a workspace using
sudo docker-up
and pulling a docker image, it has sudo with the correct setuid bit.-rwsrwxrwx 1 root root 157192 Feb 2 2020 /usr/bin/sudo
But after timeout/restarting the workspace, the sudo in the image has the wrong setuid bit
-rwxr-xr-x 1 root root 157192 Feb 2 2020 /usr/bin/sudo
Steps to reproduce
I created a minimal setup to reproduce the behavior:
https://gitpod.io/#https://github.com/shaal/gitpod-restart-test
sudo docker-up
/usr/bin/sudo
permissions (ie.docker run -it --rm drud/ddev-webserver:v1.16.3 ls -l /usr/bin/sudo
)-rwsrwxrwx
docker run -it --rm drud/ddev-webserver:v1.16.3 ls -l /usr/bin/sudo
-rwxr-xr-x
, it's missing the setuid bit.Expected behavior
The setuid bit should stay the same after restarting a workspace.
Additional information
Example repository
https://github.com/shaal/gitpod-restart-test
The text was updated successfully, but these errors were encountered: