Repository navigation
fix(builtins): bound file copies, archive output, and backup paths - #887
Merged
Merged
Conversation
ewhauser
enabled auto-merge (squash)
October 20, 2026 14:57
Merged
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.
Fixes the internal/builtins findings from the second review of main at 19ff56a.
copyBoundedwithMaxFileBytesand check for cancellation.cp /dev/zero /tmp/bigfails withcp: error writing '/tmp/big': File too largeinstead of growing until the process is killed.internal/runtime/virtual_devices.goaddsSeek, a no-op on readable virtual devices, sodd if=/dev/zero skip=9223372036854775807returns at once. Write-only handles still report an illegal seek, which keeps the existingdd seek= > /dev/fullbehavior.backing up 'y' might destroy source; 'y~' not moved).MaxFileBytes.16 × MaxFileBytesand at most 100000 members (archive exceeds extraction limit).SymlinkFollow.SPEC.md: the file-size limits bullet now lists the cp/install and stdout decompression caps and the tar extraction budget.
Each fix has a regression test (
internal/builtins/file_safety_test.go, plusTestDdDiscardObservesContext).make lintis clean, andgo test -race ./internal/builtins/... ./internal/runtime/...passes.