Skip to content
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

extract/unpack does not preserve executable files #25

Closed
bitc opened this issue Dec 12, 2017 · 5 comments · Fixed by #26
Closed

extract/unpack does not preserve executable files #25

bitc opened this issue Dec 12, 2017 · 5 comments · Fixed by #26

Comments

@bitc
Copy link

bitc commented Dec 12, 2017

When I run extract or unpack on a tarball, it extracts all of the files, but does not properly set the "executable" bit on executable files.

I have to manually run chmod +x on them after they are extracted by tar to be able to run them.

@bitc
Copy link
Author

bitc commented Dec 15, 2017

This looks relevant: snoyberg/keter@e0fa8d7

They switched from using unpack to a custom function that preserves the permissions.

@tmortiboy
Copy link
Contributor

I came across the same issue.
I was just in the middle of creating a fix to submit using setPermissions from System.Directory, but using setFileMode from System.PosixCompat.Files uses the permissions directly without need for computation.

@tmortiboy
Copy link
Contributor

tmortiboy commented Dec 15, 2017

After a little investigation, setFileMode just calls setPermissions under the hood, so will be best to just use that instead of bringing in new dependencies.
Currently have the changes on a fork, but cant get the property tests to pass (even before I made my changes).

@afranchuk
Copy link

Any word on whether this will be merged soon?

@hasufell
Copy link
Member

This is fixed in tar-bytestring (if you don't mind excluding windows support and bytestring based filepaths): hasufell@ce13c50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants