fix: eliminate TOCTOU races in ln and tac by deferring is_dir() checks#10991
Merged
sylvestre merged 4 commits intouutils:mainfrom Feb 26, 2026
Merged
fix: eliminate TOCTOU races in ln and tac by deferring is_dir() checks#10991sylvestre merged 4 commits intouutils:mainfrom
sylvestre merged 4 commits intouutils:mainfrom
Conversation
bcf8fdc to
e177167
Compare
|
GNU testsuite comparison: |
dffafc3 to
9cf958c
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
|
GNU testsuite comparison: |
8af5b77 to
ac10014
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
ln: call hard_link() first, check is_dir() only on failure for diagnostics tac: remove is_dir()/metadata() pre-checks, open file directly and let OS report errors (EISDIR, ENOENT) Closes uutils#9450
- Remove `(os error 28)` from test_failed_write_is_reported expectation to match the intentional strip_errno() behavior
a3a28ef to
e8b98bc
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
6e26c55 to
e8b98bc
Compare
|
GNU testsuite comparison: |
06621c4 to
e8b98bc
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
ln: call hard_link() first, check is_dir() only on failure for diagnostics
tac: remove is_dir()/metadata() pre-checks, open file directly and let OS report errors (EISDIR, ENOENT)
Matches GNU coreutils behavior: operate first, diagnose after.
Closes #9450