Merged
Conversation
tonistiigi
commented
Mar 14, 2025
| {0777, 0666, 0000, "-x"}, | ||
| {0777, 0777, 0000, "-X"}, | ||
| {os.ModeDir | 0777, os.ModeDir | 0777, 0000, "-X"}, | ||
| {0777, 0666, 0000, "-X"}, |
Owner
Author
There was a problem hiding this comment.
Unclear if these -X cases were intentional but I've tested new expected values against Linux.
BSD supported only + operator for X but Linux and latest POSIX supports any operator. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
1d5db84 to
3346783
Compare
4 tasks
Owner
Author
|
PTAL @crazy-max |
There was a problem hiding this comment.
Pull Request Overview
This PR updates the behavior of the X permission operator to be compatible with Linux/POSIX standards by modifying test cases and updating the parsing logic.
- Updated test cases in mode_test.go to reflect the new expected outcomes for the X operator.
- Modified the condition in mode.go's ParseWithUmask function to handle operators other than '-' when applying X permissions.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| mode_test.go | Adjusted test cases to verify Linux/POSIX-compatible behavior for the X operator |
| mode.go | Updated the conditional logic for handling the X operator to support Linux/POSIX semantics |
Comments suppressed due to low confidence (1)
mode.go:265
- Changing the condition from 'if op == "+"' to 'if op != "-"' now applies the X permission setting for both '+' and '=' operators; please verify that this behavior aligns with the desired Linux/POSIX semantics.
if op != '-' {
| {0777, 0666, 0000, "-x"}, | ||
| {0777, 0777, 0000, "-X"}, | ||
| {os.ModeDir | 0777, os.ModeDir | 0777, 0000, "-X"}, | ||
| {0777, 0666, 0000, "-X"}, |
There was a problem hiding this comment.
The expected permission value for the "-X" test case was changed from 0777 to 0666; please confirm that this update accurately reflects the intended Linux/POSIX behavior.
Suggested change
| {0777, 0666, 0000, "-X"}, | |
| {0666, 0666, 0000, "-X"}, |
crazy-max
approved these changes
Mar 18, 2025
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
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.
BSD supported only + operator for X but Linux and
latest POSIX supports any operator.
Fix for moby/buildkit#5835