-
Notifications
You must be signed in to change notification settings - Fork 3k
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
unzipping a file with with read only permissions on its zipped folders breaks #9332
Comments
@garazdawi I think you may have introduced this issue here. d6c4e1f |
Thanks for the report. The right thing to do here is probably to set all directory permissions after we have created all files and directories... and there should probably also be an option added to ignore all permissions in the archive. |
The permissions were set on extrected directories before the files within were extracted, making it impossible to create the files within. This commit delays all directory permissions to after all files/directories have been created so that they can all be set. Closed erlang#9332
The permissions were set on extrected directories before the files within were extracted, making it impossible to create the files within. This commit delays all directory permissions to after all files/directories have been created so that they can all be set. Closed erlang#9332
Fix available in #9335, please test it with your original problem. |
Just came across this bug as well and it was a doozy to figure out what was going on lol. One work around for this while we wait for a new release is to do (in Elixir) |
I'm so glad it wasn't just me that lost a day to try to figure this out. Was one of the harder bugs I've hit to trace. Huge thanks to @garazdawi for quick fix! |
Describe the bug
When you try to unzip a file that has permissions set to be read only on internal directory structure it will blow up bad match eaccess error because it's trying to create files in the folder that's read only.
To Reproduce
:zip.unzip(~c"file_test.zip", cwd: ~c"target")
(elixir code)Expected behavior
It unzips the files into the folder target.
Affected versions
OTP 27.2, but my guess is it was introduced in 27.1
Additional context
Id also settle for a option to not carry forward permissions from the zip file. Suprisingly it works if you dont pass a cwd. 🤔
The text was updated successfully, but these errors were encountered: