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

feat: setting permission mask in Entry and Archive #330

Merged
merged 1 commit into from
Jul 5, 2023
Merged

feat: setting permission mask in Entry and Archive #330

merged 1 commit into from
Jul 5, 2023

Conversation

weihanglo
Copy link
Contributor

@weihanglo weihanglo commented Jun 29, 2023

This is convenience when you want to disable some permission bits
during unpacking. Currently only support Unix.

@weihanglo
Copy link
Contributor Author

Another solution is that we can have a set_mask() function to set mask. It might also be useful when a user just wants to remove some permissions.

@joshtriplett
Copy link
Contributor

@weihanglo I would suggest splitting the UNC path fix into a separate PR?

And I do think mask would be more convenient than mode, since then tar can still handle "executable or not" itself.

@weihanglo weihanglo changed the title feat: support overwrite permission bits in Entry feat: setting permission mask in Entry and Archive Jun 30, 2023
@weihanglo
Copy link
Contributor Author

Thanks @joshtriplett. #331 has been created for UNC path fix.

And this PR is also switched to set_mask from set_mode. I am not sure about how that works on Windows though.

@alexcrichton
Copy link
Owner

Thanks! Right now the mask looks like it's inverted when applying against a mode, so could that be documented? Either that or could the mask not be inverted and the default mask is u32::MAX?

This is convenience when you want to disable some permission bits
during unpacking. Currently only support Unix.
@weihanglo
Copy link
Contributor Author

Thanks for the review! I went ahead with a logical notation. If you like not inverted one please let me know :)

@alexcrichton alexcrichton merged commit 1fd8b4e into alexcrichton:master Jul 5, 2023
7 checks passed
@weihanglo weihanglo deleted the set-mode branch July 5, 2023 22:57
@weihanglo
Copy link
Contributor Author

Thank you so much Alex! Just a little wish: Could we have a new release for the latest patches? :)

@alexcrichton
Copy link
Owner

Sorry for the delay, but sure yeah published now.

ararslan pushed a commit to ararslan/binstall-tar that referenced this pull request Jun 6, 2024
)

This is convenience when you want to disable some permission bits
during unpacking. Currently only support Unix.

(cherry picked from commit 1fd8b4e)
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 this pull request may close these issues.

3 participants