diff options
author | ooooooo-q <ooooooo-q@users.noreply.github.com> | 2021-11-27 15:17:48 +0900 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2021-11-30 01:29:34 +0900 |
commit | af59d35570d398bd590bebd11602bcb039454c0d (patch) | |
tree | 630b2a53d3d2378303d9b454312a73cd7d4da785 /lib | |
parent | a60aba18f04f6427e9b330f95f162c55f04a4971 (diff) | |
download | ruby-af59d35570d398bd590bebd11602bcb039454c0d.tar.gz |
[rubygems/rubygems] Fix escape of filenames in `bundle doctor`
https://github.com/rubygems/rubygems/commit/3ede1435ea
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/cli/doctor.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/cli/doctor.rb b/lib/bundler/cli/doctor.rb index c28997bc7d..43f1ca92e2 100644 --- a/lib/bundler/cli/doctor.rb +++ b/lib/bundler/cli/doctor.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true require "rbconfig" +require "shellwords" module Bundler class CLI::Doctor @@ -22,14 +23,14 @@ module Bundler end def dylibs_darwin(path) - output = `/usr/bin/otool -L "#{path}"`.chomp + output = `/usr/bin/otool -L #{path.shellescape}`.chomp dylibs = output.split("\n")[1..-1].map {|l| l.match(DARWIN_REGEX).captures[0] }.uniq # ignore @rpath and friends dylibs.reject {|dylib| dylib.start_with? "@" } end def dylibs_ldd(path) - output = `/usr/bin/ldd "#{path}"`.chomp + output = `/usr/bin/ldd #{path.shellescape}`.chomp output.split("\n").map do |l| match = l.match(LDD_REGEX) next if match.nil? |