Repository navigation
feat(extract): add --preserve-permissions option to maintain original file modes - #24
Merged
Merged
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
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.
This pull request introduces improved and more consistent handling of file and directory permissions when creating and extracting containers, with special attention to cross-platform (POSIX/Windows) behavior. It adds a new
--preserve-permissionsoption to extraction, ensures modes are recorded and restored correctly, documents these behaviors, and adds comprehensive tests.Permission handling improvements:
--preserve-permissionsoption to the extract command, allowing users to restore exact archived permission bits instead of applying the umask, including for existing directories. [1] [2] [3] [4] [5] [6] [7] [8]tarbehavior, and only restores archived modes exactly with--preserve-permissions. [1] [2]--preserve-permissionsis used, preventing accidental permission loosening. [1] [2]Cross-platform (Windows/POSIX) compatibility:
bfc createnow records conventional POSIX permissions (0644for files,0755for directories/executables), ignoring the CRT's emulated permissions, for consistency across platforms. [1] [2] [3] [4]Documentation updates:
README.mdto document the new--preserve-permissionsoption, the default umask behavior, and clarify cross-platform permission handling. [1] [2]Testing:
--preserve-permissionsfor both files and directories.CI improvements: