Repository navigation
fix(upgrade): unpack the new binary next to the output executable - #37120
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
Closes denoland#37116 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
NetOpWibby
pushed a commit
to theende/ende
that referenced
this pull request
Nov 7, 2026
`ende upgrade` unpacked the new binary into a directory in the system temp directory and ran it there (check_exe) before replacing the current executable. With /tmp mounted noexec, a common hardening setup, that failed with "Permission denied". Create the directory next to the output executable instead, as .ende-upgrade-XXXXXX: that directory has to be writable for the upgrade anyway, and it keeps the new binary on the same file system as its destination. If it can't be created there (say, a --dry-run of an ende in /usr/bin), fall back to the system temp directory as before. Only the regular upgrade path changes; --pr and --branch still use the system temp directory. (cherry picked from commit c64153985d2bba26e3ca829f5a6b0f8b6b779c4f) Upstream: denoland/deno#37120
|
|
This branch has not been deployed
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.
Closes #37116
deno upgradeunpacks the new binary into a directory fromtempfile::TempDir::new()and runs it there (check_exe) before replacing the current executable. When the system temp directory is mountednoexec, running it fails withPermission denied (os error 13). That is a common hardening setup for/tmp.This creates that directory next to the output executable instead, as
.deno-upgrade-XXXXXXin the directory of the currentdenoor of--output. That directory has to be writable for the upgrade anyway. It also keeps the new binary on the same file system as its destination, soreplace_execan rename it into place. If the directory can't be created there (it doesn't exist, or isn't writable, e.g. a--dry-runof adenoin/usr/bin), it falls back to the system temp directory as before.TempDirstill removes it afterwards.Only the regular upgrade path changes.
--prand--branchstill download into the system temp directory.Testing
cargo test -p deno --lib -- tools::upgrade::testpasses (31 tests).cargo clippy -p deno --lib --tests -- -D warningsandcargo fmt --checkare clean.noexecfailure end to end on Linux.AI disclosure
This PR was written primarily by Claude Code (Claude Opus 5.5), including the change, the tests and this description. It has not yet been reviewed by a human.
🤖 Generated with Claude Code