-
Notifications
You must be signed in to change notification settings - Fork 39
Compress-Archive is stripping UNIX file permissions #36
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
Comments
Just got bitten by this. |
Have similar issue. After decompressing of archive created by |
I'm running into this issue, does anyone have a solution? |
I'm running into this issue with |
After trying to roll my own permissions updater in Python and Bash, I give up. It doesn't matter what the permissions for the file are before the Steps to re-create the container I'm running it in: FROM openshift/jenkins-slave-maven-centos7:latest
...
curl https://packages.microsoft.com/config/rhel/7/prod.repo | tee /etc/yum.repos.d/microsoft.repo \
yum install -y powershell
... bash-4.2$ pwsh -version
PowerShell 7.1.0 bash-4.2$ uname -a
Linux 37d8d15bcd70 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux The Python script I tried rolling vaguely looks like this: subprocess.call(['chmod', '0755', path])
for root, dirs, files in os.walk(path):
for d in dirs:
os.chmod(os.path.join(root, d), 0o755)
for f in files:
os.chmod(os.path.join(root, f), 0o755) Good luck to those who venture further, I think the easiest way forward is to fix the cmdlet or run Powershell on native Windows. |
Got bitten by this as well. 😂 |
I'm also encountering this issue - using PowerShell to zip up and update AWS lambda function (python) from macOS. Would like to continue using PowerShell for this, but I have no option to adjust file permissions after the file is unzipped. |
Got bitten by the same bug running PS 7.0.3 GitCommitId 7.0.3 |
@b-olesen I moved my builds/deploys from windows to linux, partly because of this issue. I did temporarly pull down AWS toolkit and extract a tool from their code to do the zipping as a .net core cli tool which worked, but it was such a pain to setup. As far as I'm concerned zipping via powershell is broken, and I'm too dumb to know how to fix it to ty contribute back :( |
faced the same issue while deploying the Zip created using Compress-Archive on Azure App Service (Linux). The service fails to start by throwing |
Any tentative timelines to fix this ? |
Currently this is not possible due to .NET API limitations. |
@ayousuf23 Any ETA on when the ,net API limitations will be addressed ? |
If they haven't been in .NET 7, I would imagine it wouldn't be until at least November when .NET 8 releases. |
I think this may be possible in .NET 7? Couldn't FileSystemInfo.UnixFileMode be used to populate the ZipArchiveEntry.ExternalAttributes? |
It's worth noting that from pwsh 7.3, when this started being build for .NET 7, I think Compress-Archive should have started applying some default permissions (defined here), and that does seem to have been my experience, tested in WSL2. |
Related ticket: PowerShell/PowerShell#3590
Steps to reproduce
Result of zipinfo command
Expected behavior
Permissions of files are retained upon compression into ZIP format.
Actual behavior
Permissions are not preserved when files are compressed.
Environment data
Cheers,
Trevor Sullivan
The text was updated successfully, but these errors were encountered: