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

Posix file permissions with ZIP driver? #6

Open
robross0606 opened this issue Feb 28, 2019 · 4 comments
Open

Posix file permissions with ZIP driver? #6

robross0606 opened this issue Feb 28, 2019 · 4 comments

Comments

@robross0606
Copy link

The ZIP driver does not appear to capture any POSIX file permissions. The documentation says "best effort" and I'm aware there is an open ticket for this (https://bugs.openjdk.java.net/browse/JDK-6194856) when using standard Zip capabilities in JDK. However, I'm not sure if TrueVFS is using the JDK ZIP tools or not.

@robross0606
Copy link
Author

robross0606 commented Feb 28, 2019

If I assume you're using Apache Commons Compress (a dependency) there does appear to be support for the "Extra Fields". I'm not sure if this is where external attributes are stored or not, but this is how Linux and Mac store permissions data inside a ZIP:

https://apple.stackexchange.com/questions/329474/how-does-macos-store-unix-file-permissions-in-zip-files

@robross0606
Copy link
Author

robross0606 commented Feb 28, 2019

Apache Commons Compress does support external links, though it could be that you're using ZipArchiveInputStream instead of ZipFile. The documentation for ZipArchiveInputStream indicates that external attributes are not preserved.

@robross0606
Copy link
Author

robross0606 commented Feb 28, 2019

I just noticed in truevfs-comp-zip documentation that you specifically indicate that External File Attributes are supported. However, this does not appear to work when using TFile#cp_rp.

@christian-schlichtherle
Copy link
Owner

I'm sorry for the very late response, notifications were accidentally shut off.

TrueVFS generally doesn't support handling file permissions.
This is simply because of the complexity and thus, the effort required to implement this properly.
Even the semantics are not quite clear:
Consider the following case:
TrueVFS is a virtual file system.
So then, if permissions were supported, they should also have to be respected when accessing archive entries, right?
But then, if the "Read" bit is cleared on an archive entry, a regular (non-super) user should not even be allowed to read that entry in the archive file, which would make the archive file itself unusable (assuming the same permissions for all entries).
This is just a simple example, but my point is that the combination of permissions and use cases is too much to bear for me in this free-time project.
After all, TrueVFS is still a one-man project.
I hope you understand.
That being sad, contributions are welcome.

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

No branches or pull requests

2 participants