Skip to content

extract/unpack does not preserve executable files #25

Closed

Description

@bitc

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.

Activity

  1. bitc commented on Dec 15, 2017

    @bitc
    Author

    This looks relevant: snoyberg/keter@e0fa8d7

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

  2. tmortiboy commented on Dec 15, 2017

    @tmortiboy
    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.

  3. tmortiboy commented on Dec 15, 2017

    @tmortiboy
    Contributor

    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).

  4. afranchuk commented on Nov 9, 2018

    @afranchuk

    Any word on whether this will be merged soon?

  5. hasufell commented on Feb 19, 2020

    @hasufell
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions