feat: Use tar instead of 7zip to preserve file permissions in tar.gz packages #6791
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.
7zip
on UNIX-based systems does not support conserving permissions when creating tarballs (see Backup and limitations: https://linux.die.net/man/1/7za), so tarballs created by7zip
were always world-writable (permissions on files were set to777
for all files added to the archive).This is generally considered bad practice since it can lead to privilege escalation. This PR replaces the use of
7zip
withtar
when creating the initial tarball, which preserves the permissions from the unpackaged folder. It also allows the user to change the permissions (inafterPack
, if they want to) before creating the archive.I couldn't find an issue created for this, so I'm not sure if this approach is correct, but I'd like to offer it as a solution to the issue described above. Open to feedback/changes as always :)