Escape binstub paths in both generation commands - #142
Open
OskarEichler wants to merge 1 commit into
Open
Conversation
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.
Summary
Shell-escape String/Pathname binstub paths in both the legacy install option and standalone binstubs command.
Reproduction and verification
With bundle_binstubs set to /audit/bin with space, SSHKit renders a command whose path becomes multiple arguments. The same occurs in both command modes. Applying to_s.shellescape, as already done for bundle config values, preserves the path as one argument.
The combined installed-release candidate passes 44 focused command checks and 501 generated path/prefix cases. Five additional scenarios use real Capistrano 3.20.1, Rake and SSHKit 1.25.1 with an Abstract recording backend, including installation failure propagation. The backend records commands and performs no SSH or shell execution.
The repository contains no automated test suite or lint configuration. Its default rake task is a no-op and succeeds through rbenv; runtime syntax and package checks pass. Official/candidate packages retain 2.2.0, all 17 paths and metadata/dependencies; only lib/capistrano/tasks/bundler.cap changes. All Ruby verification uses rbenv Ruby 4.0.6. No tests were added or modified under the consuming repository's policy.
Compatibility and limitations
Ordinary paths are unchanged; whitespace and literal punctuation now reach Bundler as part of the intended path. Free-form bundle_flags and other command options are not changed. The patch does not execute remote commands or introduce a new dependency.
No deployment or production changes. Legacy Bundler command generation is checked, but old Ruby/Bundler installations and remote servers were not executed. The existing Bundler 4 default-change proposal #140 is not included.