-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add set_permissions argument #113
Conversation
The name |
I just copied that name from the original
Yes, exactly, this just does not touch file ACLs at all, which is probably what one wants in the vast majority of cases on Windows. Permissions on Windows are in almost all cases handled at the container level and then inherited, and not set on a per-file basis. For example I'm not aware of a single installer technique on Windows - by MS or anyone else- that is setting individual file level permissions, permissions are always handled on some parent folder that constitutes some sort of security boundary and then inherited to all files in that folder. The equivalent of the executable flag that signals that something can be run is really the file extension on Windows. I need a way to extract files from a tarball for https://github.com/julialang/juliaup that just does not set any file permissions on the extracted files, but has all the extracted files inherit file permissions from their parent folder. |
How about calling this |
Yes, |
@StefanKarpinski if we manage to merge this before Tue it might still make it into Julia 1.7, right? |
Yeah, we can sneak this in. Looks good to me if you add tests and docs. |
I added a test. It is not super sophisticated, but maybe good enough? Kind of tricky to write a test that really tests permissions properly, because the new behavior is that it depends on the permissions of the parent and that depends on the system on which this is running... But the test I added does exercise the code path. Docs are also there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to lax not to test permissions at all. We can at least test the resulting permissions on all non-Windows systems since those are predictable. And we can test that f_path
and x_path
have the same resulting permissions on all platforms.
Btw, once this gets merged I'll include it in Tar 1.10.0 and bump it on Julia master. I assume you don't need this on Julia 1.6.x — I don't think we can do that since this is clearly a feature that expands the API of the package. |
Codecov Report
@@ Coverage Diff @@
## master #113 +/- ##
==========================================
+ Coverage 96.05% 96.84% +0.78%
==========================================
Files 4 4
Lines 685 729 +44
==========================================
+ Hits 658 706 +48
+ Misses 27 23 -4
Continue to review full report at Codecov.
|
I've made the |
Update will be included in Julia 1.7 once this PR is merged: JuliaLang/julia#41129. |
This adds an option to extract a tarball without using any of the file permissions in the tarball.
I primarily need this on Windows so that I can extract a tarball and have all the extracted files just inherit permissions from the folder where I extract them to.
If this PR is acceptable I'll add a test and docs.