-
Notifications
You must be signed in to change notification settings - Fork 802
[universal] Jekyll feature: Fix permissions for ruby version manager folder #554
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
Merged
samruddhikhandale
merged 10 commits into
devcontainers:main
from
alexander-smolyakov:users/alexander-smolyakov/universal_fix-jekyll-local_feature
May 11, 2023
Merged
[universal] Jekyll feature: Fix permissions for ruby version manager folder #554
samruddhikhandale
merged 10 commits into
devcontainers:main
from
alexander-smolyakov:users/alexander-smolyakov/universal_fix-jekyll-local_feature
May 11, 2023
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Change the setting up permission logic to be compatible with ruby feature
…older" This reverts commit 66486ef.
- Rework the fix to sync permissions for the ruby version manager gem folder only
- Add function to check directory ownership - Add test to ensure that `codespace` user has ownership over `extension` directory
samruddhikhandale
approved these changes
May 11, 2023
Member
samruddhikhandale
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dev container name:
Description:
This PR addresses the issue with permissions when the customer is trying installs ruby gems, during installation customer is facing the following error:
The issue is related to the fact that the
x86_64-linuxfolder can be accessed only by the root user:The issue started to appear after recent changes to the ruby feature:
These changes triggered the issue with the Jekyll feature. The issue is related to the Jekyll feature not applying permissions for all required folders.
Detailed issue explanation
We install the
ruby-debug-idepackage in version v1.0.9 of the ruby feature. Because of it, RubyGems create thex86_64-linuxfolder in theextensionsfolder. Thex86_64-linuxfolder contains packages that we install via thegem installcommand. When we applychownandchmodcommands against thervmfolder, we also apply them for thex86_64-linuxfolder so that thecodespaceuser has all the required permissions to install packages.extensionsfolder layout (ruby feature v1.0.9):With version v1.0.10, we no longer install the
ruby-debug-idepackage, and as a result, theextensionsfolder is empty.extensionsfolder layout (ruby feature v1.0.10):The
jekyllfeature now creates thex86_64-linuxfolder. During feature installation, therootuser executes thegem installcommand, as a result of which only therootuser has write access to thex86_64-linuxfolder.extensionsfolder layout (ruby feature v1.0.10 + jekyll feature):The current permission sync logic works only against the
/usr/local/rvm/rubies/default/binfolder (which is just a symlink to the latest ruby version), while all gems are stored in/usr/local/rvm/gems/ruby-<version>/extensions/folder.permission sync logic:
images/src/universal/.devcontainer/local-features/jekyll/install.sh
Lines 30 to 32 in 3e64ffb
/usr/local/rvm/rubies/default/binfolder layout:Fix:
To fix the issue, we need to rework the permission-applying logic to make sure that the
/usr/local/rvm/gems/default/extensionsfolder inside the ruby version manager can be accessed by thecodespaceuser.Changelog:
/usr/local/rvm/gems/default/extensionsfolder;checkDirectoryOwnershipgeneric function to validate directory ownership by user and group;codespaceuser has ownership over theextensiondirectory.Attached related issue:
Checklist: