Skip to content

fix(logging): improved TOCTOU risk mitigation and error messaging#53

Merged
GingerGraham merged 1 commit intofix/bug-fixes-feb-2026-phase-01from
bug/52-recommended-fixes
Feb 6, 2026
Merged

fix(logging): improved TOCTOU risk mitigation and error messaging#53
GingerGraham merged 1 commit intofix/bug-fixes-feb-2026-phase-01from
bug/52-recommended-fixes

Conversation

@GingerGraham
Copy link
Owner

- addresses suggestions from #49
- fixes part of #52
- also updated Makefile to provide for parallel processing of linting
Copilot AI review requested due to automatic review settings February 6, 2026 12:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves TOCTOU (Time-of-Check-Time-of-Use) race condition mitigation in log file creation and enhances error messaging to provide clearer diagnostics when file creation fails. The changes address recommendations from issue #52 that were identified during review of PR #49.

Changes:

  • Removed the existence check before atomic file creation to eliminate TOCTOU window where an attacker could create a symlink between the check and creation
  • Added separate error messages distinguishing between "file doesn't exist" and "file exists but is wrong type" scenarios
  • Added test-quiet Make target to suppress verbose test output
  • Updated check Make target to explicitly list linting and testing dependencies

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
logging.sh Improved TOCTOU mitigation by always attempting atomic file creation without pre-checking existence; enhanced error messages to distinguish between file creation failures and wrong file type errors
Makefile Added test-quiet target for cleaner output and updated check target to explicitly depend on lint-shell, lint-markdown, and test-quiet

@GingerGraham GingerGraham merged commit 772d9cc into fix/bug-fixes-feb-2026-phase-01 Feb 6, 2026
8 checks passed
@GingerGraham GingerGraham deleted the bug/52-recommended-fixes branch February 6, 2026 13:29
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.

1 participant