Skip to content

file: validate output path for OS-specific invalid characters#4053

Open
twmb wants to merge 1 commit intomainfrom
1005
Open

file: validate output path for OS-specific invalid characters#4053
twmb wants to merge 1 commit intomainfrom
1005

Conversation

@twmb
Copy link
Copy Markdown
Contributor

@twmb twmb commented Mar 2, 2026

Override the benthos file output with a connect-local implementation that rejects characters causing silent data loss: colons on macOS (HFS+/APFS maps ':' to '/'), and <, >, :, ", |, ?, * plus control characters on Windows. NUL bytes are rejected on all platforms.

Fixes #1005.

@claude
Copy link
Copy Markdown

claude Bot commented Mar 2, 2026

Claude finished @twmb's task in 4m 40s —— View job


  • Setup: fetch PR data and read agent guidelines
  • Step 1: Commit policy validation
  • Step 2: Code review
  • Step 3: Post summary

Commits

LGTM

Review

Clean implementation that overrides the benthos file output to add OS-specific path validation. Registration pattern, field name constants, config parsing, mutex usage, and test structure all follow project conventions. One minor pattern violation found.

  1. Error wrap prefix at output_file.go#L187 uses "path interpolation error: %w" instead of gerund form ("interpolating path: %w") per godev.md.

Comment thread internal/impl/io/output_file.go Outdated
@claude

This comment was marked as resolved.

@mmatczuk
Copy link
Copy Markdown
Contributor

mmatczuk commented Mar 3, 2026

Comment thread internal/impl/io/output_file.go
@claude

This comment was marked as resolved.

Override the benthos file output with a connect-local implementation
that rejects characters causing silent data loss: colons on macOS
(HFS+/APFS maps ':' to '/'), and <, >, :, ", |, ?, * plus control
characters on Windows. NUL bytes are rejected on all platforms.

Fixes #1005.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link
Copy Markdown

claude Bot commented Apr 22, 2026

Commits
LGTM

Review
Override of the benthos file output to reject characters that cause silent data loss on Windows/macOS/all platforms. The new validateFilePath logic is well-covered by a table-driven unit test across platforms.

LGTM

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.

Invalid output file name succeeds ambiguously

3 participants