ruby-changes:70062
From: David <ko1@a...>
Date: Sun, 5 Dec 2021 05:48:03 +0900 (JST)
Subject: [ruby-changes:70062] 9dc76e102e (master): [rubygems/rubygems] Don't write outside of destdir when installing default bundler
https://git.ruby-lang.org/ruby.git/commit/?id=9dc76e102e From 9dc76e102ec00bb93b7aafaaa1309ca426d02595 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...> Date: Fri, 5 Nov 2021 13:55:09 +0100 Subject: [rubygems/rubygems] Don't write outside of destdir when installing default bundler https://github.com/rubygems/rubygems/commit/a62d00c5e8 --- lib/rubygems/commands/setup_command.rb | 1 + test/rubygems/test_gem_commands_setup_command.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/rubygems/commands/setup_command.rb b/lib/rubygems/commands/setup_command.rb index 9326496fe61..adceb62dce3 100644 --- a/lib/rubygems/commands/setup_command.rb +++ b/lib/rubygems/commands/setup_command.rb @@ -418,6 +418,7 @@ By default, this RubyGems will install gem as: https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/setup_command.rb#L418 force: options[:force], install_as_default: true, bin_dir: bin_dir, + install_dir: default_dir, wrappers: true ).install ensure diff --git a/test/rubygems/test_gem_commands_setup_command.rb b/test/rubygems/test_gem_commands_setup_command.rb index 50f99bc4198..08f94d52bfb 100644 --- a/test/rubygems/test_gem_commands_setup_command.rb +++ b/test/rubygems/test_gem_commands_setup_command.rb @@ -245,6 +245,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase https://github.com/ruby/ruby/blob/trunk/test/rubygems/test_gem_commands_setup_command.rb#L245 def test_install_default_bundler_gem_with_destdir_flag @cmd.extend FileUtils + FileUtils.chmod "-w", @gemhome + destdir = File.join(@tempdir, 'foo') bin_dir = File.join(destdir, 'bin') -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/