-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
When adding +x, get and set mode through the file descriptor #1803
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0becc91
change: Set +x via open file descriptor, not path
EliahKagan ddaf8a6
Convert the mode more portably
EliahKagan d476c06
Really convert the mode more portably
EliahKagan 492ac8b
Improve warning suppressions in `finalize_entry`
EliahKagan de939de
change: Get mode before +x using open file descriptor, not path
EliahKagan fc82e78
Extract `fstat` and `fchmod` logic to a helper
EliahKagan 588e6b0
Make `set_executable_after_creation` everywhere `bool`
EliahKagan ee7b10c
Thanks clippy
EliahKagan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It's a great idea to factor this into its own, documented function!
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.
Thanks! This
let_readers_execute
function is actually not really new in this PR, though its documentation comment is. This function was renamed (in de939de) fromset_mode_executable
, and also changed to operate on different types. I had introducedset_mode_executable
in bf33d2b (#1764) to be able to test this logic without actually doing any operations on the filesystem.In contrast, the related
set_executable
function (which callslet_readers_execute
between itsfstat
andfchmod
calls) is new in this PR. I introduced it in fc82e78, originally to make?
seamlessly work, rather than having to write.map_err(std::io::Error::from)
, but my feeling is that having it separate fromfinalize_entry
may improve readability slightly even beyond that.I wasn't sure what the best name would be for
set_executable
. I also consideredset_file_executable
, but it seemed to me that would still not be clearer with respect to the important distinction between a file descriptor and its path, and I went withset_executable
.