[rubygems/rubygems] Protect binstub access during creation with a flock

88e3f1d23c
This commit is contained in:
David Rodríguez 2024-06-26 16:47:06 +02:00 committed by git
parent 091a6ea8c1
commit 5c826ebea5
2 changed files with 20 additions and 17 deletions

View file

@ -222,7 +222,7 @@ class Gem::Installer
ruby_executable = false
existing = nil
File.open generated_bin, "rb" do |io|
Gem.open_file_with_flock generated_bin, "rb+" do |io|
line = io.gets
shebang = /^#!.*ruby/o