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

Support linux file attributes in 7z archives #17

Closed
weltkante opened this issue Jul 18, 2016 · 7 comments
Closed

Support linux file attributes in 7z archives #17

weltkante opened this issue Jul 18, 2016 · 7 comments
Assignees
Milestone

Comments

@weltkante
Copy link
Owner

Someone posted an archive over at adamhathcock/sharpcompress#73 which can't be unpacked, neither by sharpcompress nor my own managed-lzma implementation. The official 7z application seems to be able to unpack it.

Should investigate at what point my implementation diverges from the official source.

weltkante added a commit to weltkante/managed-lzma-bugs that referenced this issue Jul 18, 2016
@weltkante
Copy link
Owner Author

weltkante commented Jul 18, 2016

In a first look the metadata section of the 7z file (compressed via lzma) decodes properly (decoded checksum matches the header value) but then parsing the metadata section yields strange file attributes which make no sense; from there on it is probably broken. Right now I'm suspecting a bug in the metadata parsing code.

@weltkante
Copy link
Owner Author

Update: the archive has been created on linux, using linux file attributes. I don't parse these properly since they use different constants.

If I ignore the linux file attributes the decoder still throws an exception, so something else is going wrong.

@weltkante
Copy link
Owner Author

weltkante commented Jul 18, 2016

For the second part its the same issue as #16 just for the lzma decoder instead of lzma2 ... oops

I'm fixing that over at the other issue, leaving this issue to deal with the linux file attributes.

@weltkante weltkante changed the title Problem extracting 7z archive Support linux file attributes in 7z archives Jul 18, 2016
@weltkante weltkante self-assigned this Jul 18, 2016
@weltkante
Copy link
Owner Author

weltkante commented Jul 19, 2016

Further research shows that linux file attributes are not officially supported by 7z archives, but some 3rd party implementations abused the fact that the official codebase is lazy in its error checking and started hiding linux file attributes in unused metadata bits.

Newer versions of the 7z GUI client acknowledge this and try to parse this unofficial extension, but the main 7z codebase still does not support it, it is only handled in the UI layer.

However since it seems to have become a de-facto standard I'll update my implementation to be able to deal with it.

weltkante added a commit that referenced this issue Jul 19, 2016
@weltkante
Copy link
Owner Author

This should make it possible to read archives using this extension. I'll create a separate issue to track the possible feature request of being able to extract those posix file attributes.

@weltkante
Copy link
Owner Author

The fix for this is included in alpha-6

@weltkante weltkante added this to the v0.2-alpha-6 milestone Jul 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant