[rubygems/rubygems] Don't write outside of destdir when installing default bundler

https://github.com/rubygems/rubygems/commit/a62d00c5e8
This commit is contained in:
David Rodríguez 2021-11-05 13:55:09 +01:00 committed by git
parent ec28771fde
commit 9dc76e102e
2 changed files with 3 additions and 0 deletions

View File

@ -418,6 +418,7 @@ By default, this RubyGems will install gem as:
force: options[:force], force: options[:force],
install_as_default: true, install_as_default: true,
bin_dir: bin_dir, bin_dir: bin_dir,
install_dir: default_dir,
wrappers: true wrappers: true
).install ).install
ensure ensure

View File

@ -245,6 +245,8 @@ class TestGemCommandsSetupCommand < Gem::TestCase
def test_install_default_bundler_gem_with_destdir_flag def test_install_default_bundler_gem_with_destdir_flag
@cmd.extend FileUtils @cmd.extend FileUtils
FileUtils.chmod "-w", @gemhome
destdir = File.join(@tempdir, 'foo') destdir = File.join(@tempdir, 'foo')
bin_dir = File.join(destdir, 'bin') bin_dir = File.join(destdir, 'bin')