fix(logging): improved TOCTOU risk mitigation and error messaging#53
Merged
GingerGraham merged 1 commit intofix/bug-fixes-feb-2026-phase-01from Feb 6, 2026
Merged
Conversation
Owner
GingerGraham
commented
Feb 6, 2026
- addresses suggestions from feat: add TOCTOU race condition protection during log file creation and enhance related tests #49
- fixes part of [BUG] Recommended Fixes #52
- also updated Makefile to provide for parallel processing of linting
Contributor
There was a problem hiding this comment.
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-quietMake target to suppress verbose test output - Updated
checkMake 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 |
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.