Skip to content

Harden shell scripts against injection and failure modes#1026

Merged
svarlamov merged 3 commits intomainfrom
johnw/review-harden-scripts
Apr 11, 2026
Merged

Harden shell scripts against injection and failure modes#1026
svarlamov merged 3 commits intomainfrom
johnw/review-harden-scripts

Conversation

@jwiegley
Copy link
Copy Markdown
Collaborator

@jwiegley jwiegley commented Apr 9, 2026

  • Use mktemp for temp files instead of predictable PID-based names
  • Pass file paths via sys.argv instead of shell interpolation in Python
  • Add set -euo pipefail to scripts missing strict error handling
  • Fix pipe-to-while subshell variable scoping with here-strings
  • Add cleanup traps for temp files

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com


Open with Devin

- Use mktemp for temp files instead of predictable PID-based names
- Pass file paths via sys.argv instead of shell interpolation in Python
- Add set -euo pipefail to scripts missing strict error handling
- Fix pipe-to-while subshell variable scoping with here-strings
- Add cleanup traps for temp files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jwiegley jwiegley marked this pull request as ready for review April 9, 2026 16:55
@jwiegley jwiegley requested a review from svarlamov April 9, 2026 16:55
devin-ai-integration[bot]

This comment was marked as resolved.

@jwiegley jwiegley force-pushed the johnw/review-harden-scripts branch from d7b7e74 to 0d61f73 Compare April 9, 2026 17:28
jwiegley and others added 2 commits April 9, 2026 13:12
Use ${TEST_ARGS[@]+"${TEST_ARGS[@]}"} pattern to avoid "unbound
variable" error when TEST_ARGS is empty under set -u on macOS's
default bash 3.2, which doesn't handle empty array expansion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@svarlamov svarlamov merged commit 380a1f8 into main Apr 11, 2026
26 of 27 checks passed
@svarlamov svarlamov deleted the johnw/review-harden-scripts branch April 11, 2026 14:49
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