Skip to content

touch: drop O_TRUNC on create to close TOCTOU race (#10019)#12171

Open
sylvestre wants to merge 2 commits intouutils:mainfrom
sylvestre:toctou-touch
Open

touch: drop O_TRUNC on create to close TOCTOU race (#10019)#12171
sylvestre wants to merge 2 commits intouutils:mainfrom
sylvestre:toctou-touch

Conversation

@sylvestre
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)

@sylvestre sylvestre marked this pull request as ready for review May 7, 2026 06:44
@sylvestre sylvestre requested review from RenjiSann and cakebaker May 7, 2026 06:54
/// touch must not truncate the symlink's target. The fix drops O_TRUNC.
#[test]
#[cfg(unix)]
fn test_touch_does_not_truncate_through_planted_symlink() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it problematic if the test does not really change the nature of target between check and open ?

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.

2 participants