Skip to content

head: add TOCTOU regression tests and fix comment typo#12637

Merged
sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:head-toctou-followup
Jun 5, 2026
Merged

head: add TOCTOU regression tests and fix comment typo#12637
sylvestre merged 1 commit into
uutils:mainfrom
sylvestre:head-toctou-followup

Conversation

@sylvestre

Copy link
Copy Markdown
Contributor

No description provided.

Follow-up to the metadata TOCTOU fix (uutils#11972, PR uutils#12439):

- Add a syscall-level regression guard in util/check-safe-traversal.sh:
  under strace, head must read metadata from the open descriptor
  (fstat/statx on the fd) and must not stat the path before opening it.
  Verified this fails on the pre-fix code and passes after.
- Add an integration test asserting that an unreadable file produces an
  error but no "==> name <==" header, matching GNU (the header is only
  printed after a successful open).
- Fix a stray paren in the Windows-branch comment.
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/truncate. tests/tail/truncate is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/pid-pipe (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)

@max-amb

max-amb commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Thanks Sylvestre! :)

@sylvestre sylvestre merged commit 7d27b3b into uutils:main Jun 5, 2026
175 of 176 checks passed
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