From 2f1964803397616e17bd632084cb650b4837bf88 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 21 Feb 2018 18:32:04 +0100 Subject: [PATCH 01/21] Fix: Multiple vulnerabilities in RubyGems https://bugzilla.redhat.com/show_bug.cgi?id=1547431 https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/ * rubygems-2.5.0-multiple-vulnerabilities.patch --- ruby.spec | 12 +- rubygems-2.5.0-multiple-vulnerabilities.patch | 2349 +++++++++++++++++ 2 files changed, 2360 insertions(+), 1 deletion(-) create mode 100644 rubygems-2.5.0-multiple-vulnerabilities.patch diff --git a/ruby.spec b/ruby.spec index d4399e4..012169a 100644 --- a/ruby.spec +++ b/ruby.spec @@ -29,7 +29,7 @@ %global rubygems_dir %{_datadir}/rubygems # Bundled libraries versions -%global rubygems_version 2.7.3 +%global rubygems_version 2.7.6 %global molinillo_version 0.5.7 # TODO: The IRB has strange versioning. Keep the Ruby's versioning ATM. @@ -145,6 +145,10 @@ Patch12: ruby-2.5.0-Disable-Tokyo-TZ-tests.patch # Fix thread_safe tests suite segfaults. # https://bugs.ruby-lang.org/issues/14357 Patch13: ruby-2.5.0-st.c-retry-operations-if-rebuilt.patch +# Fix: Multiple vulnerabilities in RubyGems +# https://bugzilla.redhat.com/show_bug.cgi?id=1547431 +# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/ +Patch14: rubygems-2.5.0-multiple-vulnerabilities.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -531,6 +535,7 @@ rm -rf ext/fiddle/libffi* %patch11 -p1 %patch12 -p1 %patch13 -p1 +%patch14 -p0 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -1071,6 +1076,11 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Wed Feb 23 2018 Pavel Valena - 2.5.0-89 +- Fix: Multiple vulnerabilities in RubyGems + https://bugzilla.redhat.com/show_bug.cgi?id=1547431 + https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/ + * Tue Feb 13 2018 Vít Ondruch - 2.5.0-89 - Drop obsolete ldconfig scriptlets. - Add GMP dependency. diff --git a/rubygems-2.5.0-multiple-vulnerabilities.patch b/rubygems-2.5.0-multiple-vulnerabilities.patch new file mode 100644 index 0000000..e32926a --- /dev/null +++ b/rubygems-2.5.0-multiple-vulnerabilities.patch @@ -0,0 +1,2349 @@ +diff --git lib/rubygems.rb lib/rubygems.rb +index 0475ced164..2762bfcb88 100644 +--- lib/rubygems.rb ++++ lib/rubygems.rb +@@ -10,7 +10,7 @@ + require 'thread' + + module Gem +- VERSION = "2.7.3" ++ VERSION = "2.7.6" + end + + # Must be first since it unloads the prelude from 1.9.2 +@@ -161,7 +161,7 @@ module Gem + # these are defined in Ruby 1.8.7, hence the need for this convoluted setup. + + READ_BINARY_ERRORS = begin +- read_binary_errors = [Errno::EACCES, Errno::EROFS] ++ read_binary_errors = [Errno::EACCES, Errno::EROFS, Errno::ENOSYS] + read_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP) + read_binary_errors + end.freeze +@@ -171,7 +171,7 @@ module Gem + # these are defined in Ruby 1.8.7. + + WRITE_BINARY_ERRORS = begin +- write_binary_errors = [] ++ write_binary_errors = [Errno::ENOSYS] + write_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP) + write_binary_errors + end.freeze +@@ -871,19 +871,19 @@ def self.refresh + # Safely read a file in binary mode on all platforms. + + def self.read_binary(path) +- open path, 'rb+' do |f| ++ File.open path, 'rb+' do |f| + f.flock(File::LOCK_EX) + f.read + end + rescue *READ_BINARY_ERRORS +- open path, 'rb' do |f| ++ File.open path, 'rb' do |f| + f.read + end + rescue Errno::ENOLCK # NFS + if Thread.main != Thread.current + raise + else +- open path, 'rb' do |f| ++ File.open path, 'rb' do |f| + f.read + end + end +diff --git lib/rubygems/commands/generate_index_command.rb lib/rubygems/commands/generate_index_command.rb +index 01f1f88405..0b677b73a9 100644 +--- lib/rubygems/commands/generate_index_command.rb ++++ lib/rubygems/commands/generate_index_command.rb +@@ -68,7 +68,7 @@ def execute + + if not File.exist?(options[:directory]) or + not File.directory?(options[:directory]) then +- alert_error "unknown directory name #{directory}." ++ alert_error "unknown directory name #{options[:directory]}." + terminate_interaction 1 + else + indexer = Gem::Indexer.new options.delete(:directory), options +diff --git lib/rubygems/commands/owner_command.rb lib/rubygems/commands/owner_command.rb +index 8e2271657a..637b5bdc4d 100644 +--- lib/rubygems/commands/owner_command.rb ++++ lib/rubygems/commands/owner_command.rb +@@ -64,7 +64,7 @@ def show_owners name + end + + with_response response do |resp| +- owners = YAML.load resp.body ++ owners = Gem::SafeYAML.load resp.body + + say "Owners for gem: #{name}" + owners.each do |owner| +diff --git lib/rubygems/commands/setup_command.rb lib/rubygems/commands/setup_command.rb +index 5d1414d102..6966cde01a 100644 +--- lib/rubygems/commands/setup_command.rb ++++ lib/rubygems/commands/setup_command.rb +@@ -350,7 +350,9 @@ def fake_spec.full_gem_path + def install_default_bundler_gem + return unless Gem::USE_BUNDLER_FOR_GEMDEPS + +- mkdir_p Gem::Specification.default_specifications_dir ++ specs_dir = Gem::Specification.default_specifications_dir ++ File.join(options[:destdir], specs_dir) unless Gem.win_platform? ++ mkdir_p specs_dir + + # Workaround for non-git environment. + gemspec = File.open('bundler/bundler.gemspec', 'rb'){|f| f.read.gsub(/`git ls-files -z`/, "''") } +@@ -359,23 +361,36 @@ def install_default_bundler_gem + bundler_spec = Gem::Specification.load("bundler/bundler.gemspec") + bundler_spec.files = Dir.chdir("bundler") { Dir["{*.md,{lib,exe,man}/**/*}"] } + bundler_spec.executables -= %w[bundler bundle_ruby] +- Dir.entries(Gem::Specification.default_specifications_dir). ++ ++ # Remove bundler-*.gemspec in default specification directory. ++ Dir.entries(specs_dir). + select {|gs| gs.start_with?("bundler-") }. +- each {|gs| File.delete(File.join(Gem::Specification.default_specifications_dir, gs)) } ++ each {|gs| File.delete(File.join(specs_dir, gs)) } + +- default_spec_path = File.join(Gem::Specification.default_specifications_dir, "#{bundler_spec.full_name}.gemspec") ++ default_spec_path = File.join(specs_dir, "#{bundler_spec.full_name}.gemspec") + Gem.write_binary(default_spec_path, bundler_spec.to_ruby) + + bundler_spec = Gem::Specification.load(default_spec_path) + ++ # Remove gemspec that was same version of vendored bundler. ++ normal_gemspec = File.join(Gem.default_dir, "specifications", "bundler-#{bundler_spec.version}.gemspec") ++ if File.file? normal_gemspec ++ File.delete normal_gemspec ++ end ++ ++ # Remove gem files that were same version of vendored bundler. + if File.directory? bundler_spec.gems_dir + Dir.entries(bundler_spec.gems_dir). +- select {|default_gem| File.basename(default_gem).match(/^bundler-#{Gem::Version::VERSION_PATTERN}$/) }. ++ select {|default_gem| File.basename(default_gem) == "bundler-#{bundler_spec.version}" }. + each {|default_gem| rm_r File.join(bundler_spec.gems_dir, default_gem) } + end + +- mkdir_p bundler_spec.bin_dir +- bundler_spec.executables.each {|e| cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_spec.bin_dir, e) } ++ bundler_bin_dir = File.join(Gem.default_dir, 'gems', bundler_spec.full_name, bundler_spec.bindir) ++ File.join(options[:destdir], bundler_bin_dir) unless Gem.win_platform? ++ mkdir_p bundler_bin_dir ++ bundler_spec.executables.each do |e| ++ cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e) ++ end + + if Gem.win_platform? + require 'rubygems/installer' +diff --git lib/rubygems/commands/unpack_command.rb lib/rubygems/commands/unpack_command.rb +index eb7f550673..b873f20d28 100644 +--- lib/rubygems/commands/unpack_command.rb ++++ lib/rubygems/commands/unpack_command.rb +@@ -94,7 +94,7 @@ def execute + + spec_file = File.basename spec.spec_file + +- open spec_file, 'w' do |io| ++ File.open spec_file, 'w' do |io| + io.write metadata + end + else +@@ -176,7 +176,7 @@ def get_metadata path, security_policy = nil + + metadata = nil + +- open path, Gem.binary_mode do |io| ++ File.open path, Gem.binary_mode do |io| + tar = Gem::Package::TarReader.new io + tar.each_entry do |entry| + case entry.full_name +diff --git lib/rubygems/config_file.rb lib/rubygems/config_file.rb +index a4efed0f5a..c0d19dbfc2 100644 +--- lib/rubygems/config_file.rb ++++ lib/rubygems/config_file.rb +@@ -458,7 +458,7 @@ def to_yaml # :nodoc: + + # Writes out this config file, replacing its source. + def write +- open config_file_name, 'w' do |io| ++ File.open config_file_name, 'w' do |io| + io.write to_yaml + end + end +diff --git lib/rubygems/ext/builder.rb lib/rubygems/ext/builder.rb +index a1619c97d7..eb9db199d5 100644 +--- lib/rubygems/ext/builder.rb ++++ lib/rubygems/ext/builder.rb +@@ -212,7 +212,7 @@ def write_gem_make_out output # :nodoc: + + FileUtils.mkdir_p @spec.extension_dir + +- open destination, 'wb' do |io| io.puts output end ++ File.open destination, 'wb' do |io| io.puts output end + + destination + end +diff --git lib/rubygems/indexer.rb lib/rubygems/indexer.rb +index 871cc09d8d..3ea994414b 100644 +--- lib/rubygems/indexer.rb ++++ lib/rubygems/indexer.rb +@@ -2,6 +2,7 @@ + require 'rubygems' + require 'rubygems/package' + require 'time' ++require 'tmpdir' + + begin + gem 'builder' +@@ -64,7 +65,7 @@ def initialize(directory, options = {}) + @build_modern = options[:build_modern] + + @dest_directory = directory +- @directory = File.join(Dir.tmpdir, "gem_generate_index_#{$$}") ++ @directory = Dir.mktmpdir 'gem_generate_index' + + marshal_name = "Marshal.#{Gem.marshal_version}" + +@@ -123,7 +124,7 @@ def build_marshal_gemspecs specs + marshal_name = File.join @quick_marshal_dir, spec_file_name + + marshal_zipped = Gem.deflate Marshal.dump(spec) +- open marshal_name, 'wb' do |io| io.write marshal_zipped end ++ File.open marshal_name, 'wb' do |io| io.write marshal_zipped end + + files << marshal_name + +@@ -261,7 +262,7 @@ def compress(filename, extension) + + zipped = Gem.deflate data + +- open "#{filename}.#{extension}", 'wb' do |io| ++ File.open "#{filename}.#{extension}", 'wb' do |io| + io.write zipped + end + end +@@ -427,7 +428,7 @@ def update_specs_index(index, source, dest) + + specs_index = compact_specs specs_index.uniq.sort + +- open dest, 'wb' do |io| ++ File.open dest, 'wb' do |io| + Marshal.dump specs_index, io + end + end +diff --git lib/rubygems/installer.rb lib/rubygems/installer.rb +index 0cbca0791b..ee5fedeb64 100644 +--- lib/rubygems/installer.rb ++++ lib/rubygems/installer.rb +@@ -206,7 +206,7 @@ def check_executable_overwrite filename # :nodoc: + ruby_executable = false + existing = nil + +- open generated_bin, 'rb' do |io| ++ File.open generated_bin, 'rb' do |io| + next unless io.gets =~ /^#!/ # shebang + io.gets # blankline + +@@ -427,7 +427,7 @@ def default_spec_file + # specifications directory. + + def write_spec +- open spec_file, 'w' do |file| ++ File.open spec_file, 'w' do |file| + spec.installed_by_version = Gem.rubygems_version + + file.puts spec.to_ruby_for_cache +@@ -464,7 +464,12 @@ def generate_windows_script(filename, bindir) + def generate_bin # :nodoc: + return if spec.executables.nil? or spec.executables.empty? + +- Dir.mkdir @bin_dir unless File.exist? @bin_dir ++ begin ++ Dir.mkdir @bin_dir ++ rescue SystemCallError ++ raise unless File.directory? @bin_dir ++ end ++ + raise Gem::FilePermissionError.new(@bin_dir) unless File.writable? @bin_dir + + spec.executables.each do |filename| +@@ -863,7 +868,7 @@ def write_build_info_file + + build_info_file = File.join build_info_dir, "#{spec.full_name}.info" + +- open build_info_file, 'w' do |io| ++ File.open build_info_file, 'w' do |io| + @build_args.each do |arg| + io.puts arg + end +diff --git lib/rubygems/package.rb lib/rubygems/package.rb +index 77811ed5ec..b924122827 100644 +--- lib/rubygems/package.rb ++++ lib/rubygems/package.rb +@@ -219,7 +219,7 @@ def add_files tar # :nodoc: + next unless stat.file? + + tar.add_file_simple file, stat.mode, stat.size do |dst_io| +- open file, 'rb' do |src_io| ++ File.open file, 'rb' do |src_io| + dst_io.write src_io.read 16384 until src_io.eof? + end + end +@@ -378,9 +378,9 @@ def extract_tar_gz io, destination_dir, pattern = "*" # :nodoc: + File.dirname destination + end + +- FileUtils.mkdir_p mkdir, mkdir_options ++ mkdir_p_safe mkdir, mkdir_options, destination_dir, entry.full_name + +- open destination, 'wb' do |out| ++ File.open destination, 'wb' do |out| + out.write entry.read + FileUtils.chmod entry.header.mode, destination + end if entry.file? +@@ -416,20 +416,35 @@ def install_location filename, destination_dir # :nodoc: + raise Gem::Package::PathError.new(filename, destination_dir) if + filename.start_with? '/' + +- destination_dir = File.realpath destination_dir if +- File.respond_to? :realpath ++ destination_dir = realpath destination_dir + destination_dir = File.expand_path destination_dir + + destination = File.join destination_dir, filename + destination = File.expand_path destination + + raise Gem::Package::PathError.new(destination, destination_dir) unless +- destination.start_with? destination_dir ++ destination.start_with? destination_dir + '/' + + destination.untaint + destination + end + ++ def mkdir_p_safe mkdir, mkdir_options, destination_dir, file_name ++ destination_dir = realpath File.expand_path(destination_dir) ++ parts = mkdir.split(File::SEPARATOR) ++ parts.reduce do |path, basename| ++ path = realpath path unless path == "" ++ path = File.expand_path(path + File::SEPARATOR + basename) ++ lstat = File.lstat path rescue nil ++ if !lstat || !lstat.directory? ++ unless path.start_with? destination_dir and (FileUtils.mkdir path, mkdir_options rescue false) ++ raise Gem::Package::PathError.new(file_name, destination_dir) ++ end ++ end ++ path ++ end ++ end ++ + ## + # Loads a Gem::Specification from the TarEntry +entry+ + +@@ -603,6 +618,10 @@ def verify_files gem + raise Gem::Package::FormatError.new \ + 'package content (data.tar.gz) is missing', @gem + end ++ ++ if duplicates = @files.group_by {|f| f }.select {|k,v| v.size > 1 }.map(&:first) and duplicates.any? ++ raise Gem::Security::Exception, "duplicate files in the package: (#{duplicates.map(&:inspect).join(', ')})" ++ end + end + + ## +@@ -616,6 +635,16 @@ def verify_gz entry # :nodoc: + raise Gem::Package::FormatError.new(e.message, entry.full_name) + end + ++ if File.respond_to? :realpath ++ def realpath file ++ File.realpath file ++ end ++ else ++ def realpath file ++ file ++ end ++ end ++ + end + + require 'rubygems/package/digest_io' +diff --git lib/rubygems/package/file_source.rb lib/rubygems/package/file_source.rb +index 1a4dc4c824..ecc3a68677 100644 +--- lib/rubygems/package/file_source.rb ++++ lib/rubygems/package/file_source.rb +@@ -23,11 +23,11 @@ def present? + end + + def with_write_io &block +- open path, 'wb', &block ++ File.open path, 'wb', &block + end + + def with_read_io &block +- open path, 'rb', &block ++ File.open path, 'rb', &block + end + + end +diff --git lib/rubygems/package/old.rb lib/rubygems/package/old.rb +index f6e6e67c38..322d682ca8 100644 +--- lib/rubygems/package/old.rb ++++ lib/rubygems/package/old.rb +@@ -80,7 +80,7 @@ def extract_files destination_dir + + FileUtils.mkdir_p File.dirname destination + +- open destination, 'wb', entry['mode'] do |out| ++ File.open destination, 'wb', entry['mode'] do |out| + out.write file_data + end + +diff --git lib/rubygems/package/tar_header.rb lib/rubygems/package/tar_header.rb +index c54bd14d57..d557357114 100644 +--- lib/rubygems/package/tar_header.rb ++++ lib/rubygems/package/tar_header.rb +@@ -104,25 +104,30 @@ def self.from(stream) + fields = header.unpack UNPACK_FORMAT + + new :name => fields.shift, +- :mode => fields.shift.oct, +- :uid => fields.shift.oct, +- :gid => fields.shift.oct, +- :size => fields.shift.oct, +- :mtime => fields.shift.oct, +- :checksum => fields.shift.oct, ++ :mode => strict_oct(fields.shift), ++ :uid => strict_oct(fields.shift), ++ :gid => strict_oct(fields.shift), ++ :size => strict_oct(fields.shift), ++ :mtime => strict_oct(fields.shift), ++ :checksum => strict_oct(fields.shift), + :typeflag => fields.shift, + :linkname => fields.shift, + :magic => fields.shift, +- :version => fields.shift.oct, ++ :version => strict_oct(fields.shift), + :uname => fields.shift, + :gname => fields.shift, +- :devmajor => fields.shift.oct, +- :devminor => fields.shift.oct, ++ :devmajor => strict_oct(fields.shift), ++ :devminor => strict_oct(fields.shift), + :prefix => fields.shift, + + :empty => empty + end + ++ def self.strict_oct(str) ++ return str.oct if str =~ /\A[0-7]*\z/ ++ raise ArgumentError, "#{str.inspect} is not an octal string" ++ end ++ + ## + # Creates a new TarHeader using +vals+ + +diff --git lib/rubygems/package/tar_writer.rb lib/rubygems/package/tar_writer.rb +index f68b8d4c5e..390f7851a3 100644 +--- lib/rubygems/package/tar_writer.rb ++++ lib/rubygems/package/tar_writer.rb +@@ -196,6 +196,8 @@ def add_file_signed name, mode, signer + digest_name == signer.digest_name + end + ++ raise "no #{signer.digest_name} in #{digests.values.compact}" unless signature_digest ++ + if signer.key then + signature = signer.sign signature_digest.digest + +diff --git lib/rubygems/request_set/lockfile.rb lib/rubygems/request_set/lockfile.rb +index 7f6eadb939..76ad17d486 100644 +--- lib/rubygems/request_set/lockfile.rb ++++ lib/rubygems/request_set/lockfile.rb +@@ -223,7 +223,7 @@ def to_s + def write + content = to_s + +- open "#{@gem_deps_file}.lock", 'w' do |io| ++ File.open "#{@gem_deps_file}.lock", 'w' do |io| + io.write content + end + end +diff --git lib/rubygems/security.rb lib/rubygems/security.rb +index 4690dd9230..236577c5a3 100644 +--- lib/rubygems/security.rb ++++ lib/rubygems/security.rb +@@ -578,7 +578,7 @@ def self.trusted_certificates &block + def self.write pemmable, path, permissions = 0600, passphrase = nil, cipher = KEY_CIPHER + path = File.expand_path path + +- open path, 'wb', permissions do |io| ++ File.open path, 'wb', permissions do |io| + if passphrase and cipher + io.write pemmable.to_pem cipher, passphrase + else +diff --git lib/rubygems/security/trust_dir.rb lib/rubygems/security/trust_dir.rb +index bf44975cc6..849cf3cd3e 100644 +--- lib/rubygems/security/trust_dir.rb ++++ lib/rubygems/security/trust_dir.rb +@@ -93,7 +93,7 @@ def trust_cert certificate + + destination = cert_path certificate + +- open destination, 'wb', @permissions[:trusted_cert] do |io| ++ File.open destination, 'wb', @permissions[:trusted_cert] do |io| + io.write certificate.to_pem + end + end +diff --git lib/rubygems/server.rb lib/rubygems/server.rb +index 93b3af36f8..62c3dfe9cf 100644 +--- lib/rubygems/server.rb ++++ lib/rubygems/server.rb +@@ -623,6 +623,18 @@ def root(req, res) + executables = nil if executables.empty? + executables.last["is_last"] = true if executables + ++ # Pre-process spec homepage for safety reasons ++ begin ++ homepage_uri = URI.parse(spec.homepage) ++ if [URI::HTTP, URI::HTTPS].member? homepage_uri.class ++ homepage_uri = spec.homepage ++ else ++ homepage_uri = "." ++ end ++ rescue URI::InvalidURIError ++ homepage_uri = "." ++ end ++ + specs << { + "authors" => spec.authors.sort.join(", "), + "date" => spec.date.to_s, +@@ -632,7 +644,7 @@ def root(req, res) + "only_one_executable" => (executables && executables.size == 1), + "full_name" => spec.full_name, + "has_deps" => !deps.empty?, +- "homepage" => spec.homepage, ++ "homepage" => homepage_uri, + "name" => spec.name, + "rdoc_installed" => Gem::RDoc.new(spec).rdoc_installed?, + "ri_installed" => Gem::RDoc.new(spec).ri_installed?, +diff --git lib/rubygems/source.rb lib/rubygems/source.rb +index bd84c217a7..b28b850660 100644 +--- lib/rubygems/source.rb ++++ lib/rubygems/source.rb +@@ -160,7 +160,7 @@ def fetch_spec name_tuple + if update_cache? then + FileUtils.mkdir_p cache_dir + +- open local_spec, 'wb' do |io| ++ File.open local_spec, 'wb' do |io| + io.write spec + end + end +diff --git lib/rubygems/specification.rb lib/rubygems/specification.rb +index efc08c4738..2560324b7a 100644 +--- lib/rubygems/specification.rb ++++ lib/rubygems/specification.rb +@@ -15,6 +15,7 @@ + require 'rubygems/stub_specification' + require 'rubygems/util/list' + require 'stringio' ++require 'uri' + + ## + # The Specification class contains the information for a Gem. Typically +@@ -2822,10 +2823,16 @@ def validate packaging = true + raise Gem::InvalidSpecificationException, "#{lazy} is not a summary" + end + +- if homepage and not homepage.empty? and +- homepage !~ /\A[a-z][a-z\d+.-]*:/i then +- raise Gem::InvalidSpecificationException, +- "\"#{homepage}\" is not a URI" ++ # Make sure a homepage is valid HTTP/HTTPS URI ++ if homepage and not homepage.empty? ++ begin ++ homepage_uri = URI.parse(homepage) ++ unless [URI::HTTP, URI::HTTPS].member? homepage_uri.class ++ raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI" ++ end ++ rescue URI::InvalidURIError ++ raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI" ++ end + end + + # Warnings +diff --git lib/rubygems/stub_specification.rb lib/rubygems/stub_specification.rb +index 8337375ab4..ae2effbc84 100644 +--- lib/rubygems/stub_specification.rb ++++ lib/rubygems/stub_specification.rb +@@ -113,6 +113,8 @@ def data + unless @data + begin + saved_lineno = $. ++ ++ # TODO It should be use `File.open`, but bundler-1.16.1 example expects Kernel#open. + open loaded_from, OPEN_MODE do |file| + begin + file.readline # discard encoding line +diff --git lib/rubygems/test_case.rb lib/rubygems/test_case.rb +index f7f216e5e3..39aa4fc9a7 100644 +--- lib/rubygems/test_case.rb ++++ lib/rubygems/test_case.rb +@@ -488,7 +488,7 @@ def git_gem name = 'a', version = 1 + + gemspec = "#{name}.gemspec" + +- open File.join(directory, gemspec), 'w' do |io| ++ File.open File.join(directory, gemspec), 'w' do |io| + io.write git_spec.to_ruby + end + +@@ -592,7 +592,7 @@ def mu_pp(obj) + # Reads a Marshal file at +path+ + + def read_cache(path) +- open path.dup.untaint, 'rb' do |io| ++ File.open path.dup.untaint, 'rb' do |io| + Marshal.load io.read + end + end +@@ -612,7 +612,7 @@ def write_file(path) + dir = File.dirname path + FileUtils.mkdir_p dir unless File.directory? dir + +- open path, 'wb' do |io| ++ File.open path, 'wb' do |io| + yield io if block_given? + end + +@@ -727,7 +727,7 @@ def install_default_gems(*specs) + install_default_specs(*specs) + + specs.each do |spec| +- open spec.loaded_from, 'w' do |io| ++ File.open spec.loaded_from, 'w' do |io| + io.write spec.to_ruby_for_cache + end + end +@@ -1363,7 +1363,7 @@ def save_gemspec name = 'a', version = 1, directory = '.' + yield specification if block_given? + end + +- open File.join(directory, "#{name}.gemspec"), 'w' do |io| ++ File.open File.join(directory, "#{name}.gemspec"), 'w' do |io| + io.write vendor_spec.to_ruby + end + +diff --git lib/rubygems/test_utilities.rb lib/rubygems/test_utilities.rb +index 686916ea02..83c9d2d0fe 100644 +--- lib/rubygems/test_utilities.rb ++++ lib/rubygems/test_utilities.rb +@@ -346,7 +346,7 @@ def spec name, version, dependencies = nil, &block + end + + def write_spec spec # :nodoc: +- open spec.spec_file, 'w' do |io| ++ File.open spec.spec_file, 'w' do |io| + io.write spec.to_ruby_for_cache + end + end +diff --git lib/rubygems/util.rb lib/rubygems/util.rb +index 2de45c900b..6c75910004 100644 +--- lib/rubygems/util.rb ++++ lib/rubygems/util.rb +@@ -114,7 +114,8 @@ def self.traverse_parents directory, &block + + here = File.expand_path directory + loop do +- Dir.chdir here, &block ++ Dir.chdir here, &block rescue Errno::EACCES ++ + new_here = File.expand_path('..', here) + return if new_here == here # toplevel + here = new_here +diff --git lib/rubygems/validator.rb lib/rubygems/validator.rb +index 83448229bb..6842e4fa9c 100644 +--- lib/rubygems/validator.rb ++++ lib/rubygems/validator.rb +@@ -34,7 +34,7 @@ def verify_gem(gem_data) + # gem_path:: [String] Path to gem file + + def verify_gem_file(gem_path) +- open gem_path, Gem.binary_mode do |file| ++ File.open gem_path, Gem.binary_mode do |file| + gem_data = file.read + verify_gem gem_data + end +@@ -109,7 +109,7 @@ def alien(gems=[]) + + good, gone, unreadable = nil, nil, nil, nil + +- open gem_path, Gem.binary_mode do |file| ++ File.open gem_path, Gem.binary_mode do |file| + package = Gem::Package.new gem_path + + good, gone = package.contents.partition { |file_name| +@@ -134,7 +134,7 @@ def alien(gems=[]) + + source = File.join gem_directory, entry['path'] + +- open source, Gem.binary_mode do |f| ++ File.open source, Gem.binary_mode do |f| + unless f.read == data then + errors[gem_name][entry['path']] = "Modified from original" + end +diff --git test/rubygems/test_gem.rb test/rubygems/test_gem.rb +index 8a11cc2ecf..183771f0f3 100644 +--- test/rubygems/test_gem.rb ++++ test/rubygems/test_gem.rb +@@ -7,7 +7,7 @@ + require 'tmpdir' + + # TODO: push this up to test_case.rb once battle tested +-$SAFE=1 ++ + $LOAD_PATH.map! do |path| + path.dup.untaint + end +@@ -463,7 +463,7 @@ def test_self_ensure_gem_directories_missing_parents + assert File.directory?(util_cache_dir) + end + +- unless win_platform? then # only for FS that support write protection ++ unless win_platform? || Process.uid.zero? then # only for FS that support write protection + def test_self_ensure_gem_directories_write_protected + gemdir = File.join @tempdir, "egd" + FileUtils.rm_r gemdir rescue nil +@@ -775,7 +775,7 @@ def test_self_prefix_sitelibdir + end + + def test_self_read_binary +- open 'test', 'w' do |io| ++ File.open 'test', 'w' do |io| + io.write "\xCF\x80" + end + +@@ -1643,7 +1643,7 @@ def test_use_gemdeps + spec = Gem::Specification.find { |s| s == spec } + refute spec.activated? + +- open gem_deps_file, 'w' do |io| ++ File.open gem_deps_file, 'w' do |io| + io.write 'gem "a"' + end + +@@ -1662,7 +1662,7 @@ def test_use_gemdeps_ENV + + refute spec.activated? + +- open 'gem.deps.rb', 'w' do |io| ++ File.open 'gem.deps.rb', 'w' do |io| + io.write 'gem "a"' + end + +@@ -1706,7 +1706,7 @@ def test_use_gemdeps_automatic + + refute spec.activated? + +- open 'Gemfile', 'w' do |io| ++ File.open 'Gemfile', 'w' do |io| + io.write 'gem "a"' + end + +@@ -1735,7 +1735,7 @@ def test_use_gemdeps_disabled + + refute spec.activated? + +- open 'gem.deps.rb', 'w' do |io| ++ File.open 'gem.deps.rb', 'w' do |io| + io.write 'gem "a"' + end + +@@ -1750,7 +1750,7 @@ def test_use_gemdeps_missing_gem + skip 'Insecure operation - read' if RUBY_VERSION <= "1.8.7" + rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], 'x' + +- open 'x', 'w' do |io| ++ File.open 'x', 'w' do |io| + io.write 'gem "a"' + end + +@@ -1791,7 +1791,7 @@ def test_use_gemdeps_specific + spec = Gem::Specification.find { |s| s == spec } + refute spec.activated? + +- open 'x', 'w' do |io| ++ File.open 'x', 'w' do |io| + io.write 'gem "a"' + end + +diff --git test/rubygems/test_gem_commands_cleanup_command.rb test/rubygems/test_gem_commands_cleanup_command.rb +index c55e195975..60d208fcc0 100644 +--- test/rubygems/test_gem_commands_cleanup_command.rb ++++ test/rubygems/test_gem_commands_cleanup_command.rb +@@ -158,7 +158,7 @@ def test_execute_all_user_no_sudo + assert_path_exists @a_1_1.gem_dir + ensure + FileUtils.chmod 0755, @gemhome +- end unless win_platform? ++ end unless win_platform? || Process.uid.zero? + + def test_execute_dry_run + @cmd.options[:args] = %w[a] +diff --git test/rubygems/test_gem_commands_install_command.rb test/rubygems/test_gem_commands_install_command.rb +index dd86a85038..822d40e3f3 100644 +--- test/rubygems/test_gem_commands_install_command.rb ++++ test/rubygems/test_gem_commands_install_command.rb +@@ -131,6 +131,7 @@ def test_execute_local_transitive_prerelease + + def test_execute_no_user_install + skip 'skipped on MS Windows (chmod has no effect)' if win_platform? ++ skip 'skipped in root privilege' if Process.uid.zero? + + specs = spec_fetcher do |fetcher| + fetcher.gem 'a', 2 +diff --git test/rubygems/test_gem_commands_owner_command.rb test/rubygems/test_gem_commands_owner_command.rb +index 44652c1093..53cac4ce87 100644 +--- test/rubygems/test_gem_commands_owner_command.rb ++++ test/rubygems/test_gem_commands_owner_command.rb +@@ -43,6 +43,31 @@ def test_show_owners + assert_match %r{- 4}, @ui.output + end + ++ def test_show_owners_dont_load_objects ++ skip "testing a psych-only API" unless defined?(::Psych::DisallowedClass) ++ ++ response = < 0 +- assert Gem::Specification.find_all_by_name('x').length == 0 ++ assert Gem::Specification.find_all_by_name('x').length.zero? + end + + def test_execute_all +diff --git test/rubygems/test_gem_dependency_installer.rb test/rubygems/test_gem_dependency_installer.rb +index e55cc75682..3d76291668 100644 +--- test/rubygems/test_gem_dependency_installer.rb ++++ test/rubygems/test_gem_dependency_installer.rb +@@ -424,7 +424,7 @@ def test_install_dependency_existing_extension + extconf_rb = File.join @gemhome, 'gems', 'e-1', 'extconf.rb' + FileUtils.mkdir_p File.dirname extconf_rb + +- open extconf_rb, 'w' do |io| ++ File.open extconf_rb, 'w' do |io| + io.write <<-EXTCONF_RB + require 'mkmf' + create_makefile 'e' +diff --git test/rubygems/test_gem_doctor.rb test/rubygems/test_gem_doctor.rb +index 39b8a11692..8db65d70ce 100644 +--- test/rubygems/test_gem_doctor.rb ++++ test/rubygems/test_gem_doctor.rb +@@ -24,7 +24,7 @@ def test_doctor + + FileUtils.rm b.spec_file + +- open c.spec_file, 'w' do |io| ++ File.open c.spec_file, 'w' do |io| + io.write 'this will raise an exception when evaluated.' + end + +@@ -77,7 +77,7 @@ def test_doctor_dry_run + + FileUtils.rm b.spec_file + +- open c.spec_file, 'w' do |io| ++ File.open c.spec_file, 'w' do |io| + io.write 'this will raise an exception when evaluated.' + end + +diff --git test/rubygems/test_gem_ext_builder.rb test/rubygems/test_gem_ext_builder.rb +index d142ef28da..3dabd3e350 100644 +--- test/rubygems/test_gem_ext_builder.rb ++++ test/rubygems/test_gem_ext_builder.rb +@@ -32,7 +32,7 @@ def test_class_make + results = [] + + Dir.chdir @ext do +- open 'Makefile', 'w' do |io| ++ File.open 'Makefile', 'w' do |io| + io.puts <<-MAKEFILE + all: + \t@#{Gem.ruby} -e "puts %Q{all: \#{ENV['DESTDIR']}}" +@@ -72,7 +72,7 @@ def test_class_make_no_clean + results = [] + + Dir.chdir @ext do +- open 'Makefile', 'w' do |io| ++ File.open 'Makefile', 'w' do |io| + io.puts <<-MAKEFILE + all: + \t@#{Gem.ruby} -e "puts %Q{all: \#{ENV['DESTDIR']}}" +@@ -107,7 +107,7 @@ def test_build_extensions + + extconf_rb = File.join ext_dir, 'extconf.rb' + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' + require 'mkmf' + +@@ -168,7 +168,7 @@ def Gem.install_extension_in_lib + + extconf_rb = File.join ext_dir, 'extconf.rb' + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' + require 'mkmf' + +@@ -290,7 +290,7 @@ def test_build_extensions_with_build_args + + FileUtils.mkdir_p @spec.gem_dir + +- open File.join(@spec.gem_dir, "extconf.rb"), "w" do |f| ++ File.open File.join(@spec.gem_dir, "extconf.rb"), "w" do |f| + f.write <<-'RUBY' + puts "IN EXTCONF" + extconf_args = File.join File.dirname(__FILE__), 'extconf_args' +@@ -323,7 +323,7 @@ def test_initialize + + build_info_file = File.join build_info_dir, "#{@spec.full_name}.info" + +- open build_info_file, 'w' do |io| ++ File.open build_info_file, 'w' do |io| + io.puts '--with-foo-dir=/nonexistent' + end + +diff --git test/rubygems/test_gem_gem_runner.rb test/rubygems/test_gem_gem_runner.rb +index 0a1faa404a..d68ac4da81 100644 +--- test/rubygems/test_gem_gem_runner.rb ++++ test/rubygems/test_gem_gem_runner.rb +@@ -1,38 +1,6 @@ + # frozen_string_literal: true + require 'rubygems/test_case' +-begin +- gem_home_files = lambda{ +- if Dir.exist?(ENV["GEM_HOME"]) +- require "find" +- ary = Find.find(ENV["GEM_HOME"]).to_a +- else +- [] +- end +- } +- prev_gem_home = ENV["GEM_HOME"] +- prev_gem_home_files = gem_home_files.call +- prev_threads = Thread.list.map{|e| e.inspect} +- +- require 'rubygems/gem_runner' +-ensure +- if $! +- msg = < 'KEY' } + FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path + +- open Gem.configuration.credentials_path, 'w' do |f| ++ File.open Gem.configuration.credentials_path, 'w' do |f| + f.write keys.to_yaml + end + +@@ -59,7 +59,7 @@ def test_api_key_override + keys = { :rubygems_api_key => 'KEY', :other => 'OTHER' } + FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path + +- open Gem.configuration.credentials_path, 'w' do |f| ++ File.open Gem.configuration.credentials_path, 'w' do |f| + f.write keys.to_yaml + end + +@@ -163,7 +163,7 @@ def test_sign_in_with_other_credentials_doesnt_overwrite_other_keys + other_api_key = 'f46dbb18bb6a9c97cdc61b5b85c186a17403cdcbf' + + FileUtils.mkdir_p File.dirname(Gem.configuration.credentials_path) +- open Gem.configuration.credentials_path, 'w' do |f| ++ File.open Gem.configuration.credentials_path, 'w' do |f| + f.write Hash[:other_api_key, other_api_key].to_yaml + end + util_sign_in [api_key, 200, 'OK'] +diff --git test/rubygems/test_gem_indexer.rb test/rubygems/test_gem_indexer.rb +index a4a966e8de..5a9075e676 100644 +--- test/rubygems/test_gem_indexer.rb ++++ test/rubygems/test_gem_indexer.rb +@@ -39,8 +39,7 @@ def setup + + def test_initialize + assert_equal @tempdir, @indexer.dest_directory +- assert_equal File.join(Dir.tmpdir, "gem_generate_index_#{$$}"), +- @indexer.directory ++ assert_match %r{#{Dir.mktmpdir('gem_generate_index').match(/.*-/)}}, @indexer.directory + + indexer = Gem::Indexer.new @tempdir + assert indexer.build_modern +diff --git test/rubygems/test_gem_install_update_options.rb test/rubygems/test_gem_install_update_options.rb +index e2d546307d..371e408d27 100644 +--- test/rubygems/test_gem_install_update_options.rb ++++ test/rubygems/test_gem_install_update_options.rb +@@ -141,6 +141,8 @@ def test_user_install_enabled + def test_user_install_disabled_read_only + if win_platform? + skip('test_user_install_disabled_read_only test skipped on MS Windows') ++ elsif Process.uid.zero? ++ skip('test_user_install_disabled_read_only test skipped in root privilege') + else + @cmd.handle_options %w[--no-user-install] + +diff --git test/rubygems/test_gem_installer.rb test/rubygems/test_gem_installer.rb +index 39095c7dee..93b0482407 100644 +--- test/rubygems/test_gem_installer.rb ++++ test/rubygems/test_gem_installer.rb +@@ -140,7 +140,7 @@ def test_check_executable_overwrite_format_executable + s.require_path = 'lib' + end + +- open File.join(util_inst_bindir, 'executable'), 'w' do |io| ++ File.open File.join(util_inst_bindir, 'executable'), 'w' do |io| + io.write <<-EXEC + #!/usr/local/bin/ruby + # +@@ -437,6 +437,8 @@ def test_generate_bin_script_no_perms + + if win_platform? + skip('test_generate_bin_script_no_perms skipped on MS Windows') ++ elsif Process.uid.zero? ++ skip('test_generate_bin_script_no_perms skipped in root privilege') + else + FileUtils.chmod 0000, util_inst_bindir + +@@ -529,6 +531,8 @@ def test_generate_bin_symlink_no_perms + + if win_platform? + skip('test_generate_bin_symlink_no_perms skipped on MS Windows') ++ elsif Process.uid.zero? ++ skip('test_user_install_disabled_read_only test skipped in root privilege') + else + FileUtils.chmod 0000, util_inst_bindir + +diff --git test/rubygems/test_gem_package.rb test/rubygems/test_gem_package.rb +index cec1981c4c..d1664cf285 100644 +--- test/rubygems/test_gem_package.rb ++++ test/rubygems/test_gem_package.rb +@@ -24,7 +24,7 @@ def setup + end + + def test_class_new_old_format +- open 'old_format.gem', 'wb' do |io| ++ File.open 'old_format.gem', 'wb' do |io| + io.write SIMPLE_GEM + end + +@@ -45,7 +45,7 @@ def test_add_checksums + + FileUtils.mkdir 'lib' + +- open 'lib/code.rb', 'w' do |io| ++ File.open 'lib/code.rb', 'w' do |io| + io.write '# lib/code.rb' + end + +@@ -110,8 +110,8 @@ def test_add_files + + FileUtils.mkdir_p 'lib/empty' + +- open 'lib/code.rb', 'w' do |io| io.write '# lib/code.rb' end +- open 'lib/extra.rb', 'w' do |io| io.write '# lib/extra.rb' end ++ File.open 'lib/code.rb', 'w' do |io| io.write '# lib/code.rb' end ++ File.open 'lib/extra.rb', 'w' do |io| io.write '# lib/extra.rb' end + + package = Gem::Package.new 'bogus.gem' + package.spec = spec +@@ -140,7 +140,7 @@ def test_add_files_symlink + spec.files = %w[lib/code.rb lib/code_sym.rb] + + FileUtils.mkdir_p 'lib' +- open 'lib/code.rb', 'w' do |io| io.write '# lib/code.rb' end ++ File.open 'lib/code.rb', 'w' do |io| io.write '# lib/code.rb' end + + # NOTE: 'code.rb' is correct, because it's relative to lib/code_sym.rb + File.symlink('code.rb', 'lib/code_sym.rb') +@@ -179,7 +179,7 @@ def test_build + + FileUtils.mkdir 'lib' + +- open 'lib/code.rb', 'w' do |io| ++ File.open 'lib/code.rb', 'w' do |io| + io.write '# lib/code.rb' + end + +@@ -218,7 +218,7 @@ def test_build_auto_signed + + FileUtils.mkdir 'lib' + +- open 'lib/code.rb', 'w' do |io| ++ File.open 'lib/code.rb', 'w' do |io| + io.write '# lib/code.rb' + end + +@@ -261,7 +261,7 @@ def test_build_auto_signed_encrypted_key + + FileUtils.mkdir 'lib' + +- open 'lib/code.rb', 'w' do |io| ++ File.open 'lib/code.rb', 'w' do |io| + io.write '# lib/code.rb' + end + +@@ -311,7 +311,7 @@ def test_build_signed + + FileUtils.mkdir 'lib' + +- open 'lib/code.rb', 'w' do |io| ++ File.open 'lib/code.rb', 'w' do |io| + io.write '# lib/code.rb' + end + +@@ -348,7 +348,7 @@ def test_build_signed_encrypted_key + + FileUtils.mkdir 'lib' + +- open 'lib/code.rb', 'w' do |io| ++ File.open 'lib/code.rb', 'w' do |io| + io.write '# lib/code.rb' + end + +@@ -408,7 +408,7 @@ def test_extract_files_empty + end + end + +- open 'empty.gem', 'wb' do |io| ++ File.open 'empty.gem', 'wb' do |io| + io.write gem.string + end + +@@ -455,6 +455,31 @@ def test_extract_tar_gz_symlink_relative_path + File.read(extracted) + end + ++ def test_extract_symlink_parent ++ skip 'symlink not supported' if Gem.win_platform? ++ ++ package = Gem::Package.new @gem ++ ++ tgz_io = util_tar_gz do |tar| ++ tar.mkdir 'lib', 0755 ++ tar.add_symlink 'lib/link', '../..', 0644 ++ tar.add_file 'lib/link/outside.txt', 0644 do |io| io.write 'hi' end ++ end ++ ++ # Extract into a subdirectory of @destination; if this test fails it writes ++ # a file outside destination_subdir, but we want the file to remain inside ++ # @destination so it will be cleaned up. ++ destination_subdir = File.join @destination, 'subdir' ++ FileUtils.mkdir_p destination_subdir ++ ++ e = assert_raises Gem::Package::PathError do ++ package.extract_tar_gz tgz_io, destination_subdir ++ end ++ ++ assert_equal("installing into parent path lib/link/outside.txt of " + ++ "#{destination_subdir} is not allowed", e.message) ++ end ++ + def test_extract_tar_gz_directory + package = Gem::Package.new @gem + +@@ -566,6 +591,21 @@ def test_install_location_relative + "#{@destination} is not allowed", e.message) + end + ++ def test_install_location_suffix ++ package = Gem::Package.new @gem ++ ++ filename = "../#{File.basename(@destination)}suffix.rb" ++ ++ e = assert_raises Gem::Package::PathError do ++ package.install_location filename, @destination ++ end ++ ++ parent = File.expand_path File.join @destination, filename ++ ++ assert_equal("installing into parent path #{parent} of " + ++ "#{@destination} is not allowed", e.message) ++ end ++ + def test_load_spec + entry = StringIO.new Gem.gzip @spec.to_yaml + def entry.full_name() 'metadata.gz' end +@@ -620,7 +660,7 @@ def test_verify_checksum_bad + end + end + +- open 'mismatch.gem', 'wb' do |io| ++ File.open 'mismatch.gem', 'wb' do |io| + io.write gem.string + end + +@@ -670,7 +710,7 @@ def test_verify_checksum_missing + end + end + +- open 'data_checksum_missing.gem', 'wb' do |io| ++ File.open 'data_checksum_missing.gem', 'wb' do |io| + io.write gem.string + end + +@@ -723,6 +763,32 @@ def test_verify_nonexistent + assert_match %r%nonexistent.gem$%, e.message + end + ++ def test_verify_duplicate_file ++ FileUtils.mkdir_p 'lib' ++ FileUtils.touch 'lib/code.rb' ++ ++ build = Gem::Package.new @gem ++ build.spec = @spec ++ build.setup_signer ++ open @gem, 'wb' do |gem_io| ++ Gem::Package::TarWriter.new gem_io do |gem| ++ build.add_metadata gem ++ build.add_contents gem ++ ++ gem.add_file_simple 'a.sig', 0444, 0 ++ gem.add_file_simple 'a.sig', 0444, 0 ++ end ++ end ++ ++ package = Gem::Package.new @gem ++ ++ e = assert_raises Gem::Security::Exception do ++ package.verify ++ end ++ ++ assert_equal 'duplicate files in the package: ("a.sig")', e.message ++ end ++ + def test_verify_security_policy + skip 'openssl is missing' unless defined?(OpenSSL::SSL) + +@@ -773,14 +839,20 @@ def test_verify_security_policy_checksum_missing + FileUtils.mkdir 'lib' + FileUtils.touch 'lib/code.rb' + +- open @gem, 'wb' do |gem_io| ++ File.open @gem, 'wb' do |gem_io| + Gem::Package::TarWriter.new gem_io do |gem| + build.add_metadata gem + build.add_contents gem + + # write bogus data.tar.gz to foil signature + bogus_data = Gem.gzip 'hello' +- gem.add_file_simple 'data.tar.gz', 0444, bogus_data.length do |io| ++ fake_signer = Class.new do ++ def digest_name; 'SHA512'; end ++ def digest_algorithm; Digest(:SHA512); end ++ def key; 'key'; end ++ def sign(*); 'fake_sig'; end ++ end ++ gem.add_file_signed 'data2.tar.gz', 0444, fake_signer.new do |io| + io.write bogus_data + end + +@@ -804,7 +876,7 @@ def test_verify_security_policy_checksum_missing + end + + def test_verify_truncate +- open 'bad.gem', 'wb' do |io| ++ File.open 'bad.gem', 'wb' do |io| + io.write File.read(@gem, 1024) # don't care about newlines + end + +diff --git test/rubygems/test_gem_package_old.rb test/rubygems/test_gem_package_old.rb +index c15475b0c7..604981b3c1 100644 +--- test/rubygems/test_gem_package_old.rb ++++ test/rubygems/test_gem_package_old.rb +@@ -7,7 +7,7 @@ class TestGemPackageOld < Gem::TestCase + def setup + super + +- open 'old_format.gem', 'wb' do |io| ++ File.open 'old_format.gem', 'wb' do |io| + io.write SIMPLE_GEM + end + +diff --git test/rubygems/test_gem_package_tar_header.rb test/rubygems/test_gem_package_tar_header.rb +index d33877057d..43f508df45 100644 +--- test/rubygems/test_gem_package_tar_header.rb ++++ test/rubygems/test_gem_package_tar_header.rb +@@ -143,5 +143,26 @@ def test_update_checksum + assert_equal '012467', @tar_header.checksum + end + ++ def test_from_bad_octal ++ test_cases = [ ++ "00000006,44\000", # bogus character ++ "00000006789\000", # non-octal digit ++ "+0000001234\000", # positive sign ++ "-0000001000\000", # negative sign ++ "0x000123abc\000", # radix prefix ++ ] ++ ++ test_cases.each do |val| ++ header_s = @tar_header.to_s ++ # overwrite the size field ++ header_s[124, 12] = val ++ io = TempIO.new header_s ++ assert_raises ArgumentError do ++ new_header = Gem::Package::TarHeader.from io ++ end ++ io.close! if io.respond_to? :close! ++ end ++ end ++ + end + +diff --git test/rubygems/test_gem_rdoc.rb test/rubygems/test_gem_rdoc.rb +index 76ca8c45a9..0355883cb3 100644 +--- test/rubygems/test_gem_rdoc.rb ++++ test/rubygems/test_gem_rdoc.rb +@@ -223,6 +223,7 @@ def test_remove + + def test_remove_unwritable + skip 'chmod not supported' if Gem.win_platform? ++ skip 'skipped in root privilege' if Process.uid.zero? + FileUtils.mkdir_p @a.base_dir + FileUtils.chmod 0, @a.base_dir + +@@ -251,6 +252,7 @@ def test_setup + + def test_setup_unwritable + skip 'chmod not supported' if Gem.win_platform? ++ skip 'skipped in root privilege' if Process.uid.zero? + FileUtils.mkdir_p @a.doc_dir + FileUtils.chmod 0, @a.doc_dir + +diff --git test/rubygems/test_gem_remote_fetcher.rb test/rubygems/test_gem_remote_fetcher.rb +index ee5ac77717..20e34e84e1 100644 +--- test/rubygems/test_gem_remote_fetcher.rb ++++ test/rubygems/test_gem_remote_fetcher.rb +@@ -431,7 +431,7 @@ def test_download_install_dir + assert File.exist?(a1_cache_gem) + end + +- unless win_platform? # File.chmod doesn't work ++ unless win_platform? || Process.uid.zero? # File.chmod doesn't work + def test_download_local_read_only + FileUtils.mv @a1_gem, @tempdir + local_path = File.join @tempdir, @a1.file_name +diff --git test/rubygems/test_gem_request_set.rb test/rubygems/test_gem_request_set.rb +index 3a48827481..5dc6c1518d 100644 +--- test/rubygems/test_gem_request_set.rb ++++ test/rubygems/test_gem_request_set.rb +@@ -52,7 +52,7 @@ def test_install_from_gemdeps + rs = Gem::RequestSet.new + installed = [] + +- open 'gem.deps.rb', 'w' do |io| ++ File.open 'gem.deps.rb', 'w' do |io| + io.puts 'gem "a"' + io.flush + +@@ -78,7 +78,7 @@ def test_install_from_gemdeps_explain + + rs = Gem::RequestSet.new + +- open 'gem.deps.rb', 'w' do |io| ++ File.open 'gem.deps.rb', 'w' do |io| + io.puts 'gem "a"' + io.flush + +@@ -104,7 +104,7 @@ def test_install_from_gemdeps_install_dir + rs = Gem::RequestSet.new + installed = [] + +- open 'gem.deps.rb', 'w' do |io| ++ File.open 'gem.deps.rb', 'w' do |io| + io.puts 'gem "a"' + end + +@@ -128,7 +128,7 @@ def test_install_from_gemdeps_local + + rs = Gem::RequestSet.new + +- open 'gem.deps.rb', 'w' do |io| ++ File.open 'gem.deps.rb', 'w' do |io| + io.puts 'gem "a"' + io.flush + +@@ -150,7 +150,7 @@ def test_install_from_gemdeps_lockfile + rs = Gem::RequestSet.new + installed = [] + +- open 'gem.deps.rb.lock', 'w' do |io| ++ File.open 'gem.deps.rb.lock', 'w' do |io| + io.puts <<-LOCKFILE + GEM + remote: #{@gem_repo} +@@ -167,7 +167,7 @@ def test_install_from_gemdeps_lockfile + LOCKFILE + end + +- open 'gem.deps.rb', 'w' do |io| ++ File.open 'gem.deps.rb', 'w' do |io| + io.puts 'gem "b"' + end + +@@ -190,7 +190,7 @@ def test_install_from_gemdeps_version_mismatch + rs = Gem::RequestSet.new + installed = [] + +- open 'gem.deps.rb', 'w' do |io| ++ File.open 'gem.deps.rb', 'w' do |io| + io.puts <<-GEM_DEPS + gem "a" + ruby "0" +diff --git test/rubygems/test_gem_request_set_lockfile.rb test/rubygems/test_gem_request_set_lockfile.rb +index 908f97303e..7460b7efad 100644 +--- test/rubygems/test_gem_request_set_lockfile.rb ++++ test/rubygems/test_gem_request_set_lockfile.rb +@@ -31,7 +31,7 @@ def lockfile + def write_lockfile lockfile + @lock_file = File.expand_path "#{@gem_deps_file}.lock" + +- open @lock_file, 'w' do |io| ++ File.open @lock_file, 'w' do |io| + io.write lockfile + end + end +@@ -387,7 +387,7 @@ def test_to_s_git + s.add_dependency 'c', '~> 1.0' + end + +- open 'b.gemspec', 'w' do |io| ++ File.open 'b.gemspec', 'w' do |io| + io.write b.to_ruby + end + +@@ -400,7 +400,7 @@ def test_to_s_git + Dir.chdir 'c' do + c = Gem::Specification.new 'c', 1 + +- open 'c.gemspec', 'w' do |io| ++ File.open 'c.gemspec', 'w' do |io| + io.write c.to_ruby + end + +@@ -455,7 +455,7 @@ def test_write_error + + gem_deps_lock_file = "#{@gem_deps_file}.lock" + +- open gem_deps_lock_file, 'w' do |io| ++ File.open gem_deps_lock_file, 'w' do |io| + io.write 'hello' + end + +diff --git test/rubygems/test_gem_request_set_lockfile_parser.rb test/rubygems/test_gem_request_set_lockfile_parser.rb +index 9946c522d9..f3517da43a 100644 +--- test/rubygems/test_gem_request_set_lockfile_parser.rb ++++ test/rubygems/test_gem_request_set_lockfile_parser.rb +@@ -536,7 +536,7 @@ def test_parse_missing + end + + def write_lockfile lockfile +- open @lock_file, 'w' do |io| ++ File.open @lock_file, 'w' do |io| + io.write lockfile + end + end +diff --git test/rubygems/test_gem_request_set_lockfile_tokenizer.rb test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +index ab506a14e6..f4aba6d94a 100644 +--- test/rubygems/test_gem_request_set_lockfile_tokenizer.rb ++++ test/rubygems/test_gem_request_set_lockfile_tokenizer.rb +@@ -295,7 +295,7 @@ def test_unget + end + + def write_lockfile lockfile +- open @lock_file, 'w' do |io| ++ File.open @lock_file, 'w' do |io| + io.write lockfile + end + end +diff --git test/rubygems/test_gem_resolver_git_specification.rb test/rubygems/test_gem_resolver_git_specification.rb +index 9e8e2c5715..211757eb20 100644 +--- test/rubygems/test_gem_resolver_git_specification.rb ++++ test/rubygems/test_gem_resolver_git_specification.rb +@@ -70,7 +70,7 @@ def test_install_extension + Dir.chdir 'git/a' do + FileUtils.mkdir_p 'ext/lib' + +- open 'ext/extconf.rb', 'w' do |io| ++ File.open 'ext/extconf.rb', 'w' do |io| + io.puts 'require "mkmf"' + io.puts 'create_makefile "a"' + end +diff --git test/rubygems/test_gem_server.rb test/rubygems/test_gem_server.rb +index 6fe02e480f..a018e65512 100644 +--- test/rubygems/test_gem_server.rb ++++ test/rubygems/test_gem_server.rb +@@ -100,7 +100,7 @@ def test_latest_specs_gemdirs + specs_dir = File.join dir, 'specifications' + FileUtils.mkdir_p specs_dir + +- open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ File.open File.join(specs_dir, spec.spec_name), 'w' do |io| + io.write spec.to_ruby + end + +@@ -198,7 +198,7 @@ def test_quick_gemdirs + + FileUtils.mkdir_p specs_dir + +- open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ File.open File.join(specs_dir, spec.spec_name), 'w' do |io| + io.write spec.to_ruby + end + +@@ -339,7 +339,7 @@ def test_root_gemdirs + specs_dir = File.join dir, 'specifications' + FileUtils.mkdir_p specs_dir + +- open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ File.open File.join(specs_dir, spec.spec_name), 'w' do |io| + io.write spec.to_ruby + end + +@@ -353,6 +353,171 @@ def test_root_gemdirs + assert_match 'z 9', @res.body + end + ++ ++ def test_xss_homepage_fix_289313 ++ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" ++ dir = "#{@gemhome}2" ++ ++ spec = util_spec 'xsshomepagegem', 1 ++ spec.homepage = "javascript:confirm(document.domain)" ++ ++ specs_dir = File.join dir, 'specifications' ++ FileUtils.mkdir_p specs_dir ++ ++ open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ io.write spec.to_ruby ++ end ++ ++ server = Gem::Server.new dir, process_based_port, false ++ ++ @req.parse data ++ ++ server.root @req, @res ++ ++ assert_equal 200, @res.status ++ assert_match 'xsshomepagegem 1', @res.body ++ ++ # This verifies that the homepage for this spec is not displayed and is set to ".", because it's not a ++ # valid HTTP/HTTPS URL and could be unsafe in an HTML context. We would prefer to throw an exception here, ++ # but spec.homepage is currently free form and not currently required to be a URL, this behavior may be ++ # validated in future versions of Gem::Specification. ++ # ++ # There are two variant we're checking here, one where rdoc is not present, and one where rdoc is present in the same regex: ++ # ++ # Variant #1 - rdoc not installed ++ # ++ # xsshomepagegem 1 ++ # ++ # ++ # [rdoc] ++ # ++ # ++ # ++ # [www] ++ # ++ # Variant #2 - rdoc installed ++ # ++ # xsshomepagegem 1 ++ # ++ # ++ # \[rdoc\]<\/a> ++ # ++ # ++ # ++ # [www] ++ regex_match = /xsshomepagegem 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ ++ assert_match regex_match, @res.body ++ end ++ ++ def test_invalid_homepage ++ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" ++ dir = "#{@gemhome}2" ++ ++ spec = util_spec 'invalidhomepagegem', 1 ++ spec.homepage = "notavalidhomepageurl" ++ ++ specs_dir = File.join dir, 'specifications' ++ FileUtils.mkdir_p specs_dir ++ ++ open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ io.write spec.to_ruby ++ end ++ ++ server = Gem::Server.new dir, process_based_port, false ++ ++ @req.parse data ++ ++ server.root @req, @res ++ ++ assert_equal 200, @res.status ++ assert_match 'invalidhomepagegem 1', @res.body ++ ++ # This verifies that the homepage for this spec is not displayed and is set to ".", because it's not a ++ # valid HTTP/HTTPS URL and could be unsafe in an HTML context. We would prefer to throw an exception here, ++ # but spec.homepage is currently free form and not currently required to be a URL, this behavior may be ++ # validated in future versions of Gem::Specification. ++ # ++ # There are two variant we're checking here, one where rdoc is not present, and one where rdoc is present in the same regex: ++ # ++ # Variant #1 - rdoc not installed ++ # ++ # invalidhomepagegem 1 ++ # ++ # ++ # [rdoc] ++ # ++ # ++ # ++ # [www] ++ # ++ # Variant #2 - rdoc installed ++ # ++ # invalidhomepagegem 1 ++ # ++ # ++ # \[rdoc\]<\/a> ++ # ++ # ++ # ++ # [www] ++ regex_match = /invalidhomepagegem 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ ++ assert_match regex_match, @res.body ++ end ++ ++ def test_valid_homepage_http ++ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" ++ dir = "#{@gemhome}2" ++ ++ spec = util_spec 'validhomepagegemhttp', 1 ++ spec.homepage = "http://rubygems.org" ++ ++ specs_dir = File.join dir, 'specifications' ++ FileUtils.mkdir_p specs_dir ++ ++ open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ io.write spec.to_ruby ++ end ++ ++ server = Gem::Server.new dir, process_based_port, false ++ ++ @req.parse data ++ ++ server.root @req, @res ++ ++ assert_equal 200, @res.status ++ assert_match 'validhomepagegemhttp 1', @res.body ++ ++ regex_match = /validhomepagegemhttp 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ ++ assert_match regex_match, @res.body ++ end ++ ++ def test_valid_homepage_https ++ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" ++ dir = "#{@gemhome}2" ++ ++ spec = util_spec 'validhomepagegemhttps', 1 ++ spec.homepage = "https://rubygems.org" ++ ++ specs_dir = File.join dir, 'specifications' ++ FileUtils.mkdir_p specs_dir ++ ++ open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ io.write spec.to_ruby ++ end ++ ++ server = Gem::Server.new dir, process_based_port, false ++ ++ @req.parse data ++ ++ server.root @req, @res ++ ++ assert_equal 200, @res.status ++ assert_match 'validhomepagegemhttps 1', @res.body ++ ++ regex_match = /validhomepagegemhttps 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ ++ assert_match regex_match, @res.body ++ end ++ + def test_specs + data = StringIO.new "GET /specs.#{Gem.marshal_version} HTTP/1.0\r\n\r\n" + @req.parse data +@@ -378,7 +543,7 @@ def test_specs_gemdirs + specs_dir = File.join dir, 'specifications' + FileUtils.mkdir_p specs_dir + +- open File.join(specs_dir, spec.spec_name), 'w' do |io| ++ File.open File.join(specs_dir, spec.spec_name), 'w' do |io| + io.write spec.to_ruby + end + +diff --git test/rubygems/test_gem_source.rb test/rubygems/test_gem_source.rb +index 4a93e222f8..8805a9b404 100644 +--- test/rubygems/test_gem_source.rb ++++ test/rubygems/test_gem_source.rb +@@ -110,7 +110,7 @@ def test_fetch_spec_cached + + cache_file = File.join cache_dir, a1.spec_name + +- open cache_file, 'wb' do |io| ++ File.open cache_file, 'wb' do |io| + Marshal.dump a1, io + end + +@@ -163,7 +163,7 @@ def test_load_specs_cached + + cache_file = File.join cache_dir, "latest_specs.#{Gem.marshal_version}" + +- open cache_file, 'wb' do |io| ++ File.open cache_file, 'wb' do |io| + Marshal.dump latest_specs, io + end + +@@ -187,7 +187,7 @@ def test_load_specs_cached_empty + + cache_file = File.join cache_dir, "latest_specs.#{Gem.marshal_version}" + +- open cache_file, 'wb' do |io| ++ File.open cache_file, 'wb' do |io| + # Setup invalid data in the cache: + io.write Marshal.dump(latest_specs)[0, 10] + end +diff --git test/rubygems/test_gem_source_git.rb test/rubygems/test_gem_source_git.rb +index 0e13a11e7e..8f5d3ee745 100644 +--- test/rubygems/test_gem_source_git.rb ++++ test/rubygems/test_gem_source_git.rb +@@ -229,7 +229,7 @@ def test_specs + Dir.chdir 'b' do + b = Gem::Specification.new 'b', 1 + +- open 'b.gemspec', 'w' do |io| ++ File.open 'b.gemspec', 'w' do |io| + io.write b.to_ruby + end + +diff --git test/rubygems/test_gem_specification.rb test/rubygems/test_gem_specification.rb +index bb6acbc7de..badb297eee 100644 +--- test/rubygems/test_gem_specification.rb ++++ test/rubygems/test_gem_specification.rb +@@ -922,7 +922,7 @@ def test_self_load + end + + def test_self_load_relative +- open 'a-2.gemspec', 'w' do |io| ++ File.open 'a-2.gemspec', 'w' do |io| + io.write @a2.to_ruby_for_cache + end + +@@ -948,6 +948,9 @@ def test_self_load_tainted + @a2.files.clear + + assert_equal @a2, spec ++ ++ ensure ++ $SAFE = 0 + end + + def test_self_load_escape_curly +@@ -1111,7 +1114,7 @@ def test_self_remove_spec + end + + def test_self_remove_spec_removed +- open @a1.spec_file, 'w' do |io| ++ File.open @a1.spec_file, 'w' do |io| + io.write @a1.to_ruby + end + +@@ -1363,13 +1366,13 @@ def test_build_args + + assert_empty @ext.build_args + +- open @ext.build_info_file, 'w' do |io| ++ File.open @ext.build_info_file, 'w' do |io| + io.puts + end + + assert_empty @ext.build_args + +- open @ext.build_info_file, 'w' do |io| ++ File.open @ext.build_info_file, 'w' do |io| + io.puts '--with-foo-dir=wherever' + end + +@@ -1385,9 +1388,9 @@ def test_build_extensions + extconf_rb = File.join @ext.gem_dir, @ext.extensions.first + FileUtils.mkdir_p File.dirname extconf_rb + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' +- open 'Makefile', 'w' do |f| ++ File.open 'Makefile', 'w' do |f| + f.puts "clean:\n\techo clean" + f.puts "default:\n\techo built" + f.puts "install:\n\techo installed" +@@ -1435,9 +1438,9 @@ def test_build_extensions_default_gem + extconf_rb = File.join spec.gem_dir, spec.extensions.first + FileUtils.mkdir_p File.dirname extconf_rb + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' +- open 'Makefile', 'w' do |f| ++ File.open 'Makefile', 'w' do |f| + f.puts "default:\n\techo built" + f.puts "install:\n\techo installed" + end +@@ -1461,6 +1464,7 @@ def test_build_extensions_error + + def test_build_extensions_extensions_dir_unwritable + skip 'chmod not supported' if Gem.win_platform? ++ skip 'skipped in root privilege' if Process.uid.zero? + + ext_spec + +@@ -1469,9 +1473,9 @@ def test_build_extensions_extensions_dir_unwritable + extconf_rb = File.join @ext.gem_dir, @ext.extensions.first + FileUtils.mkdir_p File.dirname extconf_rb + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' +- open 'Makefile', 'w' do |f| ++ File.open 'Makefile', 'w' do |f| + f.puts "clean:\n\techo clean" + f.puts "default:\n\techo built" + f.puts "install:\n\techo installed" +@@ -1486,7 +1490,7 @@ def test_build_extensions_extensions_dir_unwritable + @ext.build_extensions + refute_path_exists @ext.extension_dir + ensure +- unless ($DEBUG or win_platform?) then ++ unless ($DEBUG or win_platform? or Process.uid.zero?) then + FileUtils.chmod 0755, File.join(@ext.base_dir, 'extensions') + FileUtils.chmod 0755, @ext.base_dir + end +@@ -1502,9 +1506,9 @@ def test_build_extensions_no_extensions_dir_unwritable + extconf_rb = File.join @ext.gem_dir, @ext.extensions.first + FileUtils.mkdir_p File.dirname extconf_rb + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' +- open 'Makefile', 'w' do |f| ++ File.open 'Makefile', 'w' do |f| + f.puts "clean:\n\techo clean" + f.puts "default:\n\techo built" + f.puts "install:\n\techo installed" +@@ -1551,9 +1555,9 @@ def test_build_extensions_preview + extconf_rb = File.join @ext.gem_dir, @ext.extensions.first + FileUtils.mkdir_p File.dirname extconf_rb + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' +- open 'Makefile', 'w' do |f| ++ File.open 'Makefile', 'w' do |f| + f.puts "clean:\n\techo clean" + f.puts "default:\n\techo built" + f.puts "install:\n\techo installed" +@@ -2882,7 +2886,22 @@ def test_validate_homepage + @a1.validate + end + +- assert_equal '"over at my cool site" is not a URI', e.message ++ assert_equal '"over at my cool site" is not a valid HTTP URI', e.message ++ ++ @a1.homepage = 'ftp://rubygems.org' ++ ++ e = assert_raises Gem::InvalidSpecificationException do ++ @a1.validate ++ end ++ ++ assert_equal '"ftp://rubygems.org" is not a valid HTTP URI', e.message ++ ++ @a1.homepage = 'http://rubygems.org' ++ assert_equal true, @a1.validate ++ ++ @a1.homepage = 'https://rubygems.org' ++ assert_equal true, @a1.validate ++ + end + end + +@@ -3418,9 +3437,9 @@ def test_missing_extensions_eh + extconf_rb = File.join @ext.gem_dir, @ext.extensions.first + FileUtils.mkdir_p File.dirname extconf_rb + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' +- open 'Makefile', 'w' do |f| ++ File.open 'Makefile', 'w' do |f| + f.puts "clean:\n\techo clean" + f.puts "default:\n\techo built" + f.puts "install:\n\techo installed" +diff --git test/rubygems/test_gem_stub_specification.rb test/rubygems/test_gem_stub_specification.rb +index 43680265c7..f9a3a236c0 100644 +--- test/rubygems/test_gem_stub_specification.rb ++++ test/rubygems/test_gem_stub_specification.rb +@@ -127,9 +127,9 @@ def test_missing_extensions_eh + extconf_rb = File.join s.gem_dir, s.extensions.first + FileUtils.mkdir_p File.dirname extconf_rb + +- open extconf_rb, 'w' do |f| ++ File.open extconf_rb, 'w' do |f| + f.write <<-'RUBY' +- open 'Makefile', 'w' do |f| ++ File.open 'Makefile', 'w' do |f| + f.puts "clean:\n\techo clean" + f.puts "default:\n\techo built" + f.puts "install:\n\techo installed" +@@ -149,7 +149,7 @@ def test_missing_extensions_eh_default_gem + spec = new_default_spec 'default', 1 + spec.extensions << 'extconf.rb' + +- open spec.loaded_from, 'w' do |io| ++ File.open spec.loaded_from, 'w' do |io| + io.write spec.to_ruby_for_cache + end + +@@ -198,7 +198,7 @@ def test_to_spec_missing_extensions + + def stub_with_version + spec = File.join @gemhome, 'specifications', 'stub_e-2.gemspec' +- open spec, 'w' do |io| ++ File.open spec, 'w' do |io| + io.write <<-STUB + # -*- encoding: utf-8 -*- + # stub: stub_v 2 ruby lib +@@ -221,7 +221,7 @@ def stub_with_version + + def stub_without_version + spec = File.join @gemhome, 'specifications', 'stub-2.gemspec' +- open spec, 'w' do |io| ++ File.open spec, 'w' do |io| + io.write <<-STUB + # -*- encoding: utf-8 -*- + # stub: stub_v ruby lib +@@ -245,7 +245,7 @@ def stub_without_version + + def stub_with_extension + spec = File.join @gemhome, 'specifications', 'stub_e-2.gemspec' +- open spec, 'w' do |io| ++ File.open spec, 'w' do |io| + io.write <<-STUB + # -*- encoding: utf-8 -*- + # stub: stub_e 2 ruby lib +@@ -271,7 +271,7 @@ def stub_with_extension + + def stub_without_extension + spec = File.join @gemhome, 'specifications', 'stub-2.gemspec' +- open spec, 'w' do |io| ++ File.open spec, 'w' do |io| + io.write <<-STUB + # -*- encoding: utf-8 -*- + # stub: stub 2 ruby lib +diff --git test/rubygems/test_gem_util.rb test/rubygems/test_gem_util.rb +index b85db44d51..3b7887d931 100644 +--- test/rubygems/test_gem_util.rb ++++ test/rubygems/test_gem_util.rb +@@ -5,6 +5,7 @@ + class TestGemUtil < Gem::TestCase + + def test_class_popen ++ skip "MJIT executes process and it's caught by Process.wait(-1)" if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? + assert_equal "0\n", Gem::Util.popen(Gem.ruby, '-e', 'p 0') + + assert_raises Errno::ECHILD do +@@ -29,6 +30,30 @@ def test_traverse_parents + loop { break if enum.next.nil? } # exhaust the enumerator + end + ++ def test_traverse_parents_does_not_crash_on_permissions_error ++ skip 'skipped on MS Windows (chmod has no effect)' if win_platform? ++ ++ FileUtils.mkdir_p 'd/e/f' ++ # remove 'execute' permission from "e" directory and make it ++ # impossible to cd into it and its children ++ FileUtils.chmod(0666, 'd/e') ++ ++ paths = Gem::Util.traverse_parents('d/e/f').to_a ++ ++ assert_equal File.join(@tempdir, 'd'), paths[0] ++ assert_equal @tempdir, paths[1] ++ if File.respond_to?(:realpath) ++ assert_equal File.realpath(Dir.tmpdir), paths[2] ++ assert_equal File.realpath("..", Dir.tmpdir), paths[3] ++ elsif RUBY_PLATFORM !~ /darwin/ ++ assert_equal Dir.tmpdir, paths[2] ++ assert_equal '/', paths[3] ++ end ++ ensure ++ # restore default permissions, allow the directory to be removed ++ FileUtils.chmod(0775, 'd/e') unless win_platform? ++ end ++ + def test_linked_list_find + list = [1,2,3,4,5].inject(Gem::List.new(0)) { |m,o| + Gem::List.new o, m +diff --git test/rubygems/test_gem_version.rb test/rubygems/test_gem_version.rb +index 56c818663e..792ad5f084 100644 +--- test/rubygems/test_gem_version.rb ++++ test/rubygems/test_gem_version.rb +@@ -2,6 +2,8 @@ + require 'rubygems/test_case' + require "rubygems/version" + ++require "minitest/benchmark" ++ + class TestGemVersion < Gem::TestCase + + class V < ::Gem::Version +@@ -102,6 +104,15 @@ def test_initialize_invalid + end + end + ++ def bench_anchored_version_pattern ++ assert_performance_linear 0.5 do |count| ++ version_string = count.times.map {|i| "0" * i.succ }.join(".") << "." ++ version_string =~ Gem::Version::ANCHORED_VERSION_PATTERN ++ end ++ rescue RegexpError ++ skip "It fails to allocate the memory for regex pattern of Gem::Version::ANCHORED_VERSION_PATTERN" ++ end ++ + def test_empty_version + ["", " ", " "].each do |empty| + assert_equal "0", Gem::Version.new(empty).version +diff --git test/rubygems/test_require.rb test/rubygems/test_require.rb +index a846f46833..e292ce226d 100644 +--- test/rubygems/test_require.rb ++++ test/rubygems/test_require.rb +@@ -38,18 +38,6 @@ def assert_require(path) + assert require(path), "'#{path}' was already required" + end + +- def append_latch spec +- dir = spec.gem_dir +- Dir.chdir dir do +- spec.files.each do |file| +- File.open file, 'a' do |fp| +- fp.puts "FILE_ENTERED_LATCH.release" +- fp.puts "FILE_EXIT_LATCH.await" +- end +- end +- end +- end +- + # Providing -I on the commandline should always beat gems + def test_dash_i_beats_gems + a1 = new_spec "a", "1", {"b" => "= 1"}, "lib/test_gem_require_a.rb" +@@ -80,6 +68,17 @@ def test_dash_i_beats_gems + Object.send :remove_const, :HELLO if Object.const_defined? :HELLO + end + ++ def create_sync_thread ++ Thread.new do ++ begin ++ yield ++ ensure ++ FILE_ENTERED_LATCH.release ++ FILE_EXIT_LATCH.await ++ end ++ end ++ end ++ + def test_concurrent_require + skip 'deadlock' if /^1\.8\./ =~ RUBY_VERSION + +@@ -91,11 +90,8 @@ def test_concurrent_require + + install_specs a1, b1 + +- append_latch a1 +- append_latch b1 +- +- t1 = Thread.new { assert_require 'a' } +- t2 = Thread.new { assert_require 'b' } ++ t1 = create_sync_thread{ assert_require 'a' } ++ t2 = create_sync_thread{ assert_require 'b' } + + # wait until both files are waiting on the exit latch + FILE_ENTERED_LATCH.await +@@ -106,10 +102,8 @@ def test_concurrent_require + assert t1.join, "thread 1 should exit" + assert t2.join, "thread 2 should exit" + ensure +- return if $! # skipping +- +- Object.send :remove_const, :FILE_ENTERED_LATCH +- Object.send :remove_const, :FILE_EXIT_LATCH ++ Object.send :remove_const, :FILE_ENTERED_LATCH if Object.const_defined? :FILE_ENTERED_LATCH ++ Object.send :remove_const, :FILE_EXIT_LATCH if Object.const_defined? :FILE_EXIT_LATCH + end + + def test_require_is_not_lazy_with_exact_req From 07b06bf4c31f6192b67b3facb92e6ca1fe7bee5f Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 24 Feb 2018 19:11:02 +0100 Subject: [PATCH 02/21] Use --with-setjmp-type=setjmp on aarch64 to work around gcc issue (#1545239) --- ruby.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ruby.spec b/ruby.spec index 012169a..7366e47 100644 --- a/ruby.spec +++ b/ruby.spec @@ -568,6 +568,9 @@ autoconf --with-ruby-version='' \ --enable-multiarch \ --with-prelude=./abrt_prelude.rb \ +%ifarch aarch64 + --with-setjmp-type=setjmp \ +%endif # Q= makes the build output more verbose and allows to check Fedora # compiler options. @@ -1076,7 +1079,10 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog -* Wed Feb 23 2018 Pavel Valena - 2.5.0-89 +* Sat Feb 24 2018 Florian Weimer - 2.5.0-89 +- Use --with-setjmp-type=setjmp on aarch64 to work around gcc issue (#1545239) + +* Wed Feb 21 2018 Pavel Valena - 2.5.0-89 - Fix: Multiple vulnerabilities in RubyGems https://bugzilla.redhat.com/show_bug.cgi?id=1547431 https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/ From 5d73ed5b414b7414f683db340d153a9be8f9a28c Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 21 Feb 2018 16:41:27 +0100 Subject: [PATCH 03/21] Add gcc to BuildRequires https://fedoraproject.org/wiki/Packaging:C_and_C%2B%2B#BuildRequire s_and_Requies --- ruby.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/ruby.spec b/ruby.spec index 7366e47..2a5e047 100644 --- a/ruby.spec +++ b/ruby.spec @@ -173,6 +173,7 @@ BuildRequires: procps # Required to test hardening. %{?with_hardening_test:BuildRequires: %{_bindir}/checksec} BuildRequires: multilib-rpm-config +BuildRequires: gcc # This package provides %%{_bindir}/ruby-mri therefore it is marked by this # virtual provide. It can be installed as dependency of rubypick. From 366b5ae1317b3a8eb53deb1b44bbc938ccac1bad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 1 Mar 2018 12:17:04 +0100 Subject: [PATCH 04/21] Revert "Add GMP dependency." This causes issues with building other ruby packages, since it would force every package to depend on gmp-devel. Reverting this until this gets resolved upstream: https://bugs.ruby-lang.org/issues/14422#note-6 This reverts commit 5624addc78a1a8b4a4d5dd31d76624249ce3a46d. --- ruby.spec | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ruby.spec b/ruby.spec index 2a5e047..46e9eed 100644 --- a/ruby.spec +++ b/ruby.spec @@ -21,7 +21,7 @@ %endif -%global release 89 +%global release 90 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory three, since the @@ -65,7 +65,6 @@ %bcond_without systemtap %bcond_without git %bcond_without cmake -%bcond_without gmp %if 0%{?fedora} %bcond_without hardening_test @@ -159,7 +158,6 @@ Recommends: rubygem(openssl) >= %{openssl_version} BuildRequires: autoconf BuildRequires: gdbm-devel -%{?with_hardening_test:BuildRequires: gmp-devel} BuildRequires: libffi-devel BuildRequires: openssl-devel BuildRequires: libyaml-devel @@ -1080,6 +1078,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Thu Mar 01 2018 Vít Ondruch - 2.5.0-90 +- Drop GMP dependency. + * Sat Feb 24 2018 Florian Weimer - 2.5.0-89 - Use --with-setjmp-type=setjmp on aarch64 to work around gcc issue (#1545239) From 7f6db67fc6b45e2230b48f98182913fd4600c1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 1 Mar 2018 16:50:10 +0100 Subject: [PATCH 05/21] Disable SIGSEV handler tests. SIGSEV does not provide correct output on AArch64. https://bugs.ruby-lang.org/issues/13758 --- ruby.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruby.spec b/ruby.spec index 46e9eed..03d7f49 100644 --- a/ruby.spec +++ b/ruby.spec @@ -754,6 +754,12 @@ DISABLE_TESTS="" # Once seen: http://koji.fedoraproject.org/koji/taskinfo?taskID=12556650 DISABLE_TESTS="$DISABLE_TESTS -x test_fork.rb" +# SIGSEV handler does not provide correct output on AArch64. +# https://bugs.ruby-lang.org/issues/13758 +%ifarch aarch64 +DISABLE_TESTS="$DISABLE_TESTS -n !/test_segv_\(setproctitle\|test\)/" +%endif + # Disable failing TestResolvMDNS#test_mdns_each_address test, # which fails on Koji. # https://bugs.ruby-lang.org/issues/14175 From d649e8e83af9e3dfd0bb19273be2f5bd82fd3d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 6 Mar 2018 10:46:34 +0100 Subject: [PATCH 06/21] Disable additional SIGSEV handler test. --- ruby.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby.spec b/ruby.spec index 03d7f49..3c6aea5 100644 --- a/ruby.spec +++ b/ruby.spec @@ -757,7 +757,7 @@ DISABLE_TESTS="$DISABLE_TESTS -x test_fork.rb" # SIGSEV handler does not provide correct output on AArch64. # https://bugs.ruby-lang.org/issues/13758 %ifarch aarch64 -DISABLE_TESTS="$DISABLE_TESTS -n !/test_segv_\(setproctitle\|test\)/" +DISABLE_TESTS="$DISABLE_TESTS -n !/test_segv_\(setproctitle\|test\|loaded_features\)/" %endif # Disable failing TestResolvMDNS#test_mdns_each_address test, From 7bbdc3fdb9b98d2b5b7006a50c8e0bfc73c39ccb Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 29 Mar 2018 15:25:06 +0200 Subject: [PATCH 07/21] Update to Ruby 2.5.1. --- ...-additional-preludes-by-configuratio.patch | 2 +- ...0-Enable-configuration-of-archlibdir.patch | 2 +- ...ed-paths-when-empty-version-string-i.patch | 2 +- ruby-2.1.0-always-use-i386.patch | 2 +- ruby-2.1.0-custom-rubygems-location.patch | 4 +- ruby-2.3.0-ruby_version.patch | 6 +- ruby-2.5.0-Disable-Tokyo-TZ-tests.patch | 30 - ruby-2.5.0-parse.y-assignable_error.patch | 80 - ...5.0-st.c-retry-operations-if-rebuilt.patch | 602 ----- ...-test-failures-Kiritimati-and-Lisbon.patch | 115 + ruby.spec | 30 +- rubygems-2.5.0-multiple-vulnerabilities.patch | 2349 ----------------- sources | 2 +- 13 files changed, 133 insertions(+), 3093 deletions(-) delete mode 100644 ruby-2.5.0-Disable-Tokyo-TZ-tests.patch delete mode 100644 ruby-2.5.0-parse.y-assignable_error.patch delete mode 100644 ruby-2.5.0-st.c-retry-operations-if-rebuilt.patch create mode 100644 ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch delete mode 100644 rubygems-2.5.0-multiple-vulnerabilities.patch diff --git a/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch b/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch index 66cb565..47bf9bc 100644 --- a/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch +++ b/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch @@ -39,7 +39,7 @@ diff --git a/configure.ac b/configure.ac index 028ef7ca3e..cdeff87871 100644 --- a/configure.ac +++ b/configure.ac -@@ -4395,6 +4395,13 @@ AC_SUBST(rubyarchhdrdir)dnl +@@ -4396,6 +4396,13 @@ AC_SUBST(rubyarchhdrdir)dnl AC_SUBST(sitearchhdrdir)dnl AC_SUBST(vendorarchhdrdir)dnl diff --git a/ruby-2.1.0-Enable-configuration-of-archlibdir.patch b/ruby-2.1.0-Enable-configuration-of-archlibdir.patch index 41444c5..36ec460 100644 --- a/ruby-2.1.0-Enable-configuration-of-archlibdir.patch +++ b/ruby-2.1.0-Enable-configuration-of-archlibdir.patch @@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac index 11fc237552..b77e88fc37 100644 --- a/configure.ac +++ b/configure.ac -@@ -3640,6 +3640,11 @@ AS_IF([test ${multiarch+set}], [ +@@ -3641,6 +3641,11 @@ AS_IF([test ${multiarch+set}], [ ]) archlibdir='${libdir}/${arch}' diff --git a/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch b/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch index bdc074d..d0cffab 100644 --- a/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch +++ b/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch @@ -14,7 +14,7 @@ diff --git a/configure.ac b/configure.ac index 999e2d6d5d..11fc237552 100644 --- a/configure.ac +++ b/configure.ac -@@ -4250,7 +4250,8 @@ AS_CASE(["$ruby_version_dir_name"], +@@ -4251,7 +4251,8 @@ AS_CASE(["$ruby_version_dir_name"], ruby_version_dir=/'${ruby_version_dir_name}' if test -z "${ruby_version_dir_name}"; then diff --git a/ruby-2.1.0-always-use-i386.patch b/ruby-2.1.0-always-use-i386.patch index 4864741..555ad45 100644 --- a/ruby-2.1.0-always-use-i386.patch +++ b/ruby-2.1.0-always-use-i386.patch @@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac index b77e88fc37..6bba453e3c 100644 --- a/configure.ac +++ b/configure.ac -@@ -4314,6 +4314,8 @@ AC_SUBST(vendorarchdir)dnl +@@ -4315,6 +4315,8 @@ AC_SUBST(vendorarchdir)dnl AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl diff --git a/ruby-2.1.0-custom-rubygems-location.patch b/ruby-2.1.0-custom-rubygems-location.patch index cc55c4a..cc45741 100644 --- a/ruby-2.1.0-custom-rubygems-location.patch +++ b/ruby-2.1.0-custom-rubygems-location.patch @@ -15,7 +15,7 @@ diff --git a/configure.ac b/configure.ac index 6bba453e3c..028ef7ca3e 100644 --- a/configure.ac +++ b/configure.ac -@@ -4286,6 +4286,10 @@ AC_ARG_WITH(vendorarchdir, +@@ -4287,6 +4287,10 @@ AC_ARG_WITH(vendorarchdir, [vendorarchdir=$withval], [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}]) @@ -26,7 +26,7 @@ index 6bba453e3c..028ef7ca3e 100644 AS_IF([test "${LOAD_RELATIVE+set}"], [ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) RUBY_EXEC_PREFIX='' -@@ -4310,6 +4314,7 @@ AC_SUBST(sitearchdir)dnl +@@ -4311,6 +4315,7 @@ AC_SUBST(sitearchdir)dnl AC_SUBST(vendordir)dnl AC_SUBST(vendorlibdir)dnl AC_SUBST(vendorarchdir)dnl diff --git a/ruby-2.3.0-ruby_version.patch b/ruby-2.3.0-ruby_version.patch index 5e24003..8f57319 100644 --- a/ruby-2.3.0-ruby_version.patch +++ b/ruby-2.3.0-ruby_version.patch @@ -20,7 +20,7 @@ diff --git a/configure.ac b/configure.ac index 8ea969412f..a00f2b6776 100644 --- a/configure.ac +++ b/configure.ac -@@ -4201,9 +4201,6 @@ AS_CASE(["$target_os"], +@@ -4202,9 +4202,6 @@ AS_CASE(["$target_os"], rubyw_install_name='$(RUBYW_INSTALL_NAME)' ]) @@ -30,7 +30,7 @@ index 8ea969412f..a00f2b6776 100644 rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'} AC_ARG_WITH(rubyarchprefix, AS_HELP_STRING([--with-rubyarchprefix=DIR], -@@ -4226,56 +4223,62 @@ AC_ARG_WITH(ridir, +@@ -4227,56 +4224,62 @@ AC_ARG_WITH(ridir, AC_SUBST(ridir) AC_SUBST(RI_BASE_NAME) @@ -120,7 +120,7 @@ index 8ea969412f..a00f2b6776 100644 AS_IF([test "${LOAD_RELATIVE+set}"], [ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) -@@ -4292,6 +4295,7 @@ AC_SUBST(sitearchincludedir)dnl +@@ -4293,6 +4296,7 @@ AC_SUBST(sitearchincludedir)dnl AC_SUBST(arch)dnl AC_SUBST(sitearch)dnl AC_SUBST(ruby_version)dnl diff --git a/ruby-2.5.0-Disable-Tokyo-TZ-tests.patch b/ruby-2.5.0-Disable-Tokyo-TZ-tests.patch deleted file mode 100644 index 01632eb..0000000 --- a/ruby-2.5.0-Disable-Tokyo-TZ-tests.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb -index 20a57fe7dd..5b9e5a8bde 100644 ---- a/test/ruby/test_time_tz.rb -+++ b/test/ruby/test_time_tz.rb -@@ -126,8 +126,8 @@ def test_asia_singapore - - def test_asia_tokyo - with_tz(tz="Asia/Tokyo") { -- assert_time_constructor(tz, "1951-05-06 03:00:00 +1000", :local, [1951,5,6,2,0,0]) -- assert_time_constructor(tz, "1951-05-06 03:59:59 +1000", :local, [1951,5,6,2,59,59]) -+# assert_time_constructor(tz, "1951-05-06 03:00:00 +1000", :local, [1951,5,6,2,0,0]) -+# assert_time_constructor(tz, "1951-05-06 03:59:59 +1000", :local, [1951,5,6,2,59,59]) - assert_time_constructor(tz, "2010-06-10 06:13:28 +0900", :local, [2010,6,10,6,13,28]) - } - end -@@ -329,10 +329,10 @@ def self.gen_zdump_test(data) - Asia/Singapore Sun Aug 8 16:30:00 1965 UTC = Mon Aug 9 00:00:00 1965 SGT isdst=0 gmtoff=27000 - Asia/Singapore Thu Dec 31 16:29:59 1981 UTC = Thu Dec 31 23:59:59 1981 SGT isdst=0 gmtoff=27000 - Asia/Singapore Thu Dec 31 16:30:00 1981 UTC = Fri Jan 1 00:30:00 1982 SGT isdst=0 gmtoff=28800 --Asia/Tokyo Sat May 5 16:59:59 1951 UTC = Sun May 6 01:59:59 1951 JST isdst=0 gmtoff=32400 --Asia/Tokyo Sat May 5 17:00:00 1951 UTC = Sun May 6 03:00:00 1951 JDT isdst=1 gmtoff=36000 --Asia/Tokyo Fri Sep 7 15:59:59 1951 UTC = Sat Sep 8 01:59:59 1951 JDT isdst=1 gmtoff=36000 --Asia/Tokyo Fri Sep 7 16:00:00 1951 UTC = Sat Sep 8 01:00:00 1951 JST isdst=0 gmtoff=32400 -+#Asia/Tokyo Sat May 5 16:59:59 1951 UTC = Sun May 6 01:59:59 1951 JST isdst=0 gmtoff=32400 -+#Asia/Tokyo Sat May 5 17:00:00 1951 UTC = Sun May 6 03:00:00 1951 JDT isdst=1 gmtoff=36000 -+#Asia/Tokyo Fri Sep 7 15:59:59 1951 UTC = Sat Sep 8 01:59:59 1951 JDT isdst=1 gmtoff=36000 -+#Asia/Tokyo Fri Sep 7 16:00:00 1951 UTC = Sat Sep 8 01:00:00 1951 JST isdst=0 gmtoff=32400 - America/St_Johns Sun Mar 11 03:30:59 2007 UTC = Sun Mar 11 00:00:59 2007 NST isdst=0 gmtoff=-12600 - America/St_Johns Sun Mar 11 03:31:00 2007 UTC = Sun Mar 11 01:01:00 2007 NDT isdst=1 gmtoff=-9000 - America/St_Johns Sun Nov 4 02:30:59 2007 UTC = Sun Nov 4 00:00:59 2007 NDT isdst=1 gmtoff=-9000 diff --git a/ruby-2.5.0-parse.y-assignable_error.patch b/ruby-2.5.0-parse.y-assignable_error.patch deleted file mode 100644 index ea7dad9..0000000 --- a/ruby-2.5.0-parse.y-assignable_error.patch +++ /dev/null @@ -1,80 +0,0 @@ -From: nobu -Date: Sun, 31 Dec 2017 11:25:38 +0000 -Subject: [PATCH] parse.y: assignable_error - -* parse.y (assignable_gen): should return valid NODE always even - on errors. [ruby-core:84565] [Bug #14261] - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - parse.c | 14 ++++---------- - test/ruby/test_parse.rb | 6 ++++++ - 2 files changed, 10 insertions(+), 10 deletions(-) - -diff --git a/parse.c b/parse.c -index 08c3461f7096..c260a046dc33 100644 ---- a/parse.c -+++ b/parse.c -@@ -6593,10 +6593,6 @@ - #line 1984 "parse.y" /* yacc.c:1646 */ - { - (yyval.node) = assignable(var_field((yyvsp[0].id)), 0, &(yyloc)); -- /*%%%*/ -- if (!(yyval.node)) (yyval.node) = new_begin(0, &(yyloc)); -- /*% -- %*/ - } - #line 6598 "parse.c" /* yacc.c:1646 */ - break; -@@ -6605,10 +6601,6 @@ - #line 1992 "parse.y" /* yacc.c:1646 */ - { - (yyval.node) = assignable(var_field((yyvsp[0].id)), 0, &(yyloc)); -- /*%%%*/ -- if (!(yyval.node)) (yyval.node) = new_begin(0, &(yyloc)); -- /*% -- %*/ - } - #line 6610 "parse.c" /* yacc.c:1646 */ - break; -@@ -16034,11 +16026,13 @@ - #ifdef RIPPER - ID id = get_id(lhs); - # define assignable_result(x) (lhs) -+# define assignable_error() (lhs) - # define parser_yyerror(parser, x) (lhs = assign_error_gen(parser, lhs)) - #else - # define assignable_result(x) assignable_result0(x, location) -+# define assignable_error() new_begin(0, location) - #endif -- if (!id) return assignable_result(0); -+ if (!id) return assignable_error(); - switch (id) { - case keyword_self: - yyerror0("Can't change the value of self"); -@@ -16101,7 +16095,7 @@ - compile_error(PARSER_ARG "identifier %"PRIsVALUE" is not valid to set", rb_id2str(id)); - } - error: -- return assignable_result(0); -+ return assignable_error(); - #undef assignable_result - #undef parser_yyerror - } -diff --git a/test/ruby/test_parse.rb b/test/ruby/test_parse.rb -index e26bcdc07e19..15c6245bac2e 100644 ---- a/test/ruby/test_parse.rb -+++ b/test/ruby/test_parse.rb -@@ -746,6 +746,12 @@ def foo - end - END - end -+ assert_raise(SyntaxError) do -+ eval "#{<<~"begin;"}\n#{<<~'end;'}", nil, __FILE__, __LINE__+1 -+ begin; -+ x, true -+ end; -+ end - end - - def test_block_dup diff --git a/ruby-2.5.0-st.c-retry-operations-if-rebuilt.patch b/ruby-2.5.0-st.c-retry-operations-if-rebuilt.patch deleted file mode 100644 index 1e8e3b6..0000000 --- a/ruby-2.5.0-st.c-retry-operations-if-rebuilt.patch +++ /dev/null @@ -1,602 +0,0 @@ -From 4663c224fa6c925ce54af32fd1c1cbac9508f5ec Mon Sep 17 00:00:00 2001 -From: normal -Date: Tue, 13 Feb 2018 10:02:07 +0000 -Subject: [PATCH] st.c: retry operations if rebuilt - -Calling the .eql? and .hash methods during a Hash operation can -result in a thread switch or a signal handler to run: allowing -one execution context to rebuild the hash table while another is -still reading or writing the table. This results in a -use-after-free bug affecting the thread_safe-0.3.6 test suite -and likely other bugs. - -This bug did not affect users of commonly keys (String, Symbol, -Fixnum) as those are optimized to avoid method dispatch -for .eql? and .hash methods. - -A separate version of this change needs to be ported to Ruby 2.3.x -which had a different implementation of st.c but was affected -by the same bug. - -* st.c: Add comment about table rebuilding during comparison. - (DO_PTR_EQUAL_CHECK): New macro. - (REBUILT_TABLE_ENTRY_IND, REBUILT_TABLE_BIN_IND): New macros. - (find_entry, find_table_entry_ind, find_table_bin_ind): Use new - macros. Return the rebuild flag. - (find_table_bin_ptr_and_reserve): Ditto. - (st_lookup, st_get_key, st_insert, st_insert2): Retry the - operation if the table was rebuilt. - (st_general_delete, st_shift, st_update, st_general_foreach): - Ditto. - (st_rehash_linear, st_rehash_indexed): Use DO_PTR_EQUAL_CHECK. - Return the rebuild flag. - (st_rehash): Retry the operation if the table was rebuilt. - [ruby-core:85510] [Ruby trunk Bug#14357] - -Thanks to Vit Ondruch for reporting the bug. - -From: Vladimir Makarov - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - st.c | 258 ++++++++++++++++++++++++++++++++++++++++++++++++------------------- - 1 file changed, 185 insertions(+), 73 deletions(-) - -diff --git a/st.c b/st.c -index 56ae30ce47..0c52e7a2ef 100644 ---- a/st.c -+++ b/st.c -@@ -90,6 +90,11 @@ - o To save more memory we use 8-, 16-, 32- and 64- bit indexes in - bins depending on the current hash table size. - -+ o The implementation takes into account that the table can be -+ rebuilt during hashing or comparison functions. It can happen if -+ the functions are implemented in Ruby and a thread switch occurs -+ during their execution. -+ - This implementation speeds up the Ruby hash table benchmarks in - average by more 40% on Intel Haswell CPU. - -@@ -174,6 +179,15 @@ static const struct st_hash_type type_strcasehash = { - #define PTR_EQUAL(tab, ptr, hash_val, key_) \ - ((ptr)->hash == (hash_val) && EQUAL((tab), (key_), (ptr)->key)) - -+/* As PRT_EQUAL only its result is returned in RES. REBUILT_P is set -+ up to TRUE if the table is rebuilt during the comparison. */ -+#define DO_PTR_EQUAL_CHECK(tab, ptr, hash_val, key, res, rebuilt_p) \ -+ do { \ -+ unsigned int _old_rebuilds_num = (tab)->rebuilds_num; \ -+ res = PTR_EQUAL(tab, ptr, hash_val, key); \ -+ rebuilt_p = _old_rebuilds_num != (tab)->rebuilds_num; \ -+ } while (FALSE) -+ - /* Features of a table. */ - struct st_features { - /* Power of 2 used for number of allocated entries. */ -@@ -380,6 +394,11 @@ set_bin(st_index_t *bins, int s, st_index_t n, st_index_t v) - #define UNDEFINED_ENTRY_IND (~(st_index_t) 0) - #define UNDEFINED_BIN_IND (~(st_index_t) 0) - -+/* Entry and bin values returned when we found a table rebuild during -+ the search. */ -+#define REBUILT_TABLE_ENTRY_IND (~(st_index_t) 1) -+#define REBUILT_TABLE_BIN_IND (~(st_index_t) 1) -+ - /* Mark I-th bin of table TAB as corresponding to a deleted table - entry. Update number of entries in the table and number of bins - corresponding to deleted entries. */ -@@ -823,17 +842,22 @@ secondary_hash(st_index_t ind, st_table *tab, st_index_t *perterb) - - /* Find an entry with HASH_VALUE and KEY in TABLE using a linear - search. Return the index of the found entry in array `entries`. -- If it is not found, return UNDEFINED_ENTRY_IND. */ -+ If it is not found, return UNDEFINED_ENTRY_IND. If the table was -+ rebuilt during the search, return REBUILT_TABLE_ENTRY_IND. */ - static inline st_index_t - find_entry(st_table *tab, st_hash_t hash_value, st_data_t key) - { -+ int eq_p, rebuilt_p; - st_index_t i, bound; - st_table_entry *entries; - - bound = tab->entries_bound; - entries = tab->entries; - for (i = tab->entries_start; i < bound; i++) { -- if (PTR_EQUAL(tab, &entries[i], hash_value, key)) -+ DO_PTR_EQUAL_CHECK(tab, &entries[i], hash_value, key, eq_p, rebuilt_p); -+ if (EXPECT(rebuilt_p, 0)) -+ return REBUILT_TABLE_ENTRY_IND; -+ if (eq_p) - return i; - } - return UNDEFINED_ENTRY_IND; -@@ -845,10 +869,12 @@ find_entry(st_table *tab, st_hash_t hash_value, st_data_t key) - /*#define QUADRATIC_PROBE*/ - - /* Return index of entry with HASH_VALUE and KEY in table TAB. If -- there is no such entry, return UNDEFINED_ENTRY_IND. */ -+ there is no such entry, return UNDEFINED_ENTRY_IND. If the table -+ was rebuilt during the search, return REBUILT_TABLE_ENTRY_IND. */ - static st_index_t - find_table_entry_ind(st_table *tab, st_hash_t hash_value, st_data_t key) - { -+ int eq_p, rebuilt_p; - st_index_t ind; - #ifdef QUADRATIC_PROBE - st_index_t d; -@@ -869,10 +895,13 @@ find_table_entry_ind(st_table *tab, st_hash_t hash_value, st_data_t key) - FOUND_BIN; - for (;;) { - bin = get_bin(tab->bins, get_size_ind(tab), ind); -- if (! EMPTY_OR_DELETED_BIN_P(bin) -- && PTR_EQUAL(tab, &entries[bin - ENTRY_BASE], hash_value, key)) -- break; -- else if (EMPTY_BIN_P(bin)) -+ if (! EMPTY_OR_DELETED_BIN_P(bin)) { -+ DO_PTR_EQUAL_CHECK(tab, &entries[bin - ENTRY_BASE], hash_value, key, eq_p, rebuilt_p); -+ if (EXPECT(rebuilt_p, 0)) -+ return REBUILT_TABLE_ENTRY_IND; -+ if (eq_p) -+ break; -+ } else if (EMPTY_BIN_P(bin)) - return UNDEFINED_ENTRY_IND; - #ifdef QUADRATIC_PROBE - ind = hash_bin(ind + d, tab); -@@ -887,10 +916,12 @@ find_table_entry_ind(st_table *tab, st_hash_t hash_value, st_data_t key) - - /* Find and return index of table TAB bin corresponding to an entry - with HASH_VALUE and KEY. If there is no such bin, return -- UNDEFINED_BIN_IND. */ -+ UNDEFINED_BIN_IND. If the table was rebuilt during the search, -+ return REBUILT_TABLE_BIN_IND. */ - static st_index_t - find_table_bin_ind(st_table *tab, st_hash_t hash_value, st_data_t key) - { -+ int eq_p, rebuilt_p; - st_index_t ind; - #ifdef QUADRATIC_PROBE - st_index_t d; -@@ -911,10 +942,13 @@ find_table_bin_ind(st_table *tab, st_hash_t hash_value, st_data_t key) - FOUND_BIN; - for (;;) { - bin = get_bin(tab->bins, get_size_ind(tab), ind); -- if (! EMPTY_OR_DELETED_BIN_P(bin) -- && PTR_EQUAL(tab, &entries[bin - ENTRY_BASE], hash_value, key)) -- break; -- else if (EMPTY_BIN_P(bin)) -+ if (! EMPTY_OR_DELETED_BIN_P(bin)) { -+ DO_PTR_EQUAL_CHECK(tab, &entries[bin - ENTRY_BASE], hash_value, key, eq_p, rebuilt_p); -+ if (EXPECT(rebuilt_p, 0)) -+ return REBUILT_TABLE_BIN_IND; -+ if (eq_p) -+ break; -+ } else if (EMPTY_BIN_P(bin)) - return UNDEFINED_BIN_IND; - #ifdef QUADRATIC_PROBE - ind = hash_bin(ind + d, tab); -@@ -955,7 +989,7 @@ find_table_bin_ind_direct(st_table *tab, st_hash_t hash_value, st_data_t key) - bin = get_bin(tab->bins, get_size_ind(tab), ind); - if (EMPTY_OR_DELETED_BIN_P(bin)) - return ind; -- st_assert (! PTR_EQUAL(tab, &entries[bin - ENTRY_BASE], hash_value, key)); -+ st_assert (entries[bin - ENTRY_BASE].hash != hash_value); - #ifdef QUADRATIC_PROBE - ind = hash_bin(ind + d, tab); - d++; -@@ -973,11 +1007,13 @@ find_table_bin_ind_direct(st_table *tab, st_hash_t hash_value, st_data_t key) - bigger entries array. Although we can reuse a deleted bin, the - result bin value is always empty if the table has no entry with - KEY. Return the entries array index of the found entry or -- UNDEFINED_ENTRY_IND if it is not found. */ -+ UNDEFINED_ENTRY_IND if it is not found. If the table was rebuilt -+ during the search, return REBUILT_TABLE_ENTRY_IND. */ - static st_index_t - find_table_bin_ptr_and_reserve(st_table *tab, st_hash_t *hash_value, - st_data_t key, st_index_t *bin_ind) - { -+ int eq_p, rebuilt_p; - st_index_t ind; - st_hash_t curr_hash_value = *hash_value; - #ifdef QUADRATIC_PROBE -@@ -1015,7 +1051,10 @@ find_table_bin_ptr_and_reserve(st_table *tab, st_hash_t *hash_value, - break; - } - else if (! DELETED_BIN_P(entry_index)) { -- if (PTR_EQUAL(tab, &entries[entry_index - ENTRY_BASE], curr_hash_value, key)) -+ DO_PTR_EQUAL_CHECK(tab, &entries[entry_index - ENTRY_BASE], curr_hash_value, key, eq_p, rebuilt_p); -+ if (EXPECT(rebuilt_p, 0)) -+ return REBUILT_TABLE_ENTRY_IND; -+ if (eq_p) - break; - } - else if (first_deleted_bin_ind == UNDEFINED_BIN_IND) -@@ -1040,13 +1079,18 @@ st_lookup(st_table *tab, st_data_t key, st_data_t *value) - st_index_t bin; - st_hash_t hash = do_hash(key, tab); - -+ retry: - if (tab->bins == NULL) { - bin = find_entry(tab, hash, key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - if (bin == UNDEFINED_ENTRY_IND) - return 0; - } - else { - bin = find_table_entry_ind(tab, hash, key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - if (bin == UNDEFINED_ENTRY_IND) - return 0; - bin -= ENTRY_BASE; -@@ -1064,13 +1108,18 @@ st_get_key(st_table *tab, st_data_t key, st_data_t *result) - st_index_t bin; - st_hash_t hash = do_hash(key, tab); - -+ retry: - if (tab->bins == NULL) { - bin = find_entry(tab, hash, key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - if (bin == UNDEFINED_ENTRY_IND) - return 0; - } - else { - bin = find_table_entry_ind(tab, hash, key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - if (bin == UNDEFINED_ENTRY_IND) - return 0; - bin -= ENTRY_BASE; -@@ -1104,10 +1153,13 @@ st_insert(st_table *tab, st_data_t key, st_data_t value) - st_index_t bin_ind; - int new_p; - -- rebuild_table_if_necessary(tab); - hash_value = do_hash(key, tab); -+ retry: -+ rebuild_table_if_necessary(tab); - if (tab->bins == NULL) { - bin = find_entry(tab, hash_value, key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - new_p = bin == UNDEFINED_ENTRY_IND; - if (new_p) - tab->num_entries++; -@@ -1116,6 +1168,8 @@ st_insert(st_table *tab, st_data_t key, st_data_t value) - else { - bin = find_table_bin_ptr_and_reserve(tab, &hash_value, - key, &bin_ind); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - new_p = bin == UNDEFINED_ENTRY_IND; - bin -= ENTRY_BASE; - } -@@ -1192,10 +1246,13 @@ st_insert2(st_table *tab, st_data_t key, st_data_t value, - st_index_t bin_ind; - int new_p; - -- rebuild_table_if_necessary (tab); - hash_value = do_hash(key, tab); -+ retry: -+ rebuild_table_if_necessary (tab); - if (tab->bins == NULL) { - bin = find_entry(tab, hash_value, key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - new_p = bin == UNDEFINED_ENTRY_IND; - if (new_p) - tab->num_entries++; -@@ -1204,6 +1261,8 @@ st_insert2(st_table *tab, st_data_t key, st_data_t value, - else { - bin = find_table_bin_ptr_and_reserve(tab, &hash_value, - key, &bin_ind); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - new_p = bin == UNDEFINED_ENTRY_IND; - bin -= ENTRY_BASE; - } -@@ -1212,7 +1271,6 @@ st_insert2(st_table *tab, st_data_t key, st_data_t value, - check = tab->rebuilds_num; - key = (*func)(key); - st_assert(check == tab->rebuilds_num); -- st_assert(do_hash(key, tab) == hash_value); - ind = tab->entries_bound++; - entry = &tab->entries[ind]; - entry->hash = hash_value; -@@ -1220,6 +1278,7 @@ st_insert2(st_table *tab, st_data_t key, st_data_t value, - entry->record = value; - if (bin_ind != UNDEFINED_BIN_IND) - set_bin(tab->bins, get_size_ind(tab), bin_ind, ind + ENTRY_BASE); -+ st_assert(do_hash(key, tab) == hash_value); - #ifdef ST_DEBUG - st_check(tab); - #endif -@@ -1281,8 +1340,11 @@ st_general_delete(st_table *tab, st_data_t *key, st_data_t *value) - - st_assert(tab != NULL); - hash = do_hash(*key, tab); -+ retry: - if (tab->bins == NULL) { - bin = find_entry(tab, hash, *key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - if (bin == UNDEFINED_ENTRY_IND) { - if (value != 0) *value = 0; - return 0; -@@ -1290,6 +1352,8 @@ st_general_delete(st_table *tab, st_data_t *key, st_data_t *value) - } - else { - bin_ind = find_table_bin_ind(tab, hash, *key); -+ if (EXPECT(bin_ind == REBUILT_TABLE_BIN_IND, 0)) -+ goto retry; - if (bin_ind == UNDEFINED_BIN_IND) { - if (value != 0) *value = 0; - return 0; -@@ -1344,21 +1408,33 @@ st_shift(st_table *tab, st_data_t *key, st_data_t *value) - for (i = tab->entries_start; i < bound; i++) { - curr_entry_ptr = &entries[i]; - if (! DELETED_ENTRY_P(curr_entry_ptr)) { -+ st_hash_t entry_hash = curr_entry_ptr->hash; -+ st_data_t entry_key = curr_entry_ptr->key; -+ - if (value != 0) *value = curr_entry_ptr->record; -- *key = curr_entry_ptr->key; -+ *key = entry_key; -+ retry: - if (tab->bins == NULL) { -- bin = find_entry(tab, curr_entry_ptr->hash, curr_entry_ptr->key); -+ bin = find_entry(tab, entry_hash, entry_key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) { -+ entries = tab->entries; -+ goto retry; -+ } - st_assert(bin != UNDEFINED_ENTRY_IND); -- st_assert(&entries[bin] == curr_entry_ptr); -+ curr_entry_ptr = &entries[bin]; - } - else { -- bin_ind = find_table_bin_ind(tab, curr_entry_ptr->hash, -- curr_entry_ptr->key); -+ bin_ind = find_table_bin_ind(tab, entry_hash, entry_key); -+ if (EXPECT(bin_ind == REBUILT_TABLE_BIN_IND, 0)) { -+ entries = tab->entries; -+ goto retry; -+ } - st_assert(bin_ind != UNDEFINED_BIN_IND); -- st_assert(&entries[get_bin(tab->bins, get_size_ind(tab), bin_ind) -- - ENTRY_BASE] == curr_entry_ptr); -+ curr_entry_ptr = &entries[get_bin(tab->bins, get_size_ind(tab), bin_ind) -+ - ENTRY_BASE]; - MARK_BIN_DELETED(tab, bin_ind); - } -+ st_assert(entry_hash != curr_entry_ptr->hash && entry_key == curr_entry_ptr->key); - MARK_ENTRY_DELETED(curr_entry_ptr); - tab->num_entries--; - update_range_for_deleted(tab, i); -@@ -1402,15 +1478,20 @@ st_update(st_table *tab, st_data_t key, - int retval, existing; - st_hash_t hash = do_hash(key, tab); - -+ retry: - entries = tab->entries; - if (tab->bins == NULL) { - bin = find_entry(tab, hash, key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - existing = bin != UNDEFINED_ENTRY_IND; - entry = &entries[bin]; - bin_ind = UNDEFINED_BIN_IND; - } - else { - bin_ind = find_table_bin_ind(tab, hash, key); -+ if (EXPECT(bin_ind == REBUILT_TABLE_BIN_IND, 0)) -+ goto retry; - existing = bin_ind != UNDEFINED_BIN_IND; - if (existing) { - bin = get_bin(tab->bins, get_size_ind(tab), bin_ind) - ENTRY_BASE; -@@ -1489,14 +1570,19 @@ st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_data_t arg, - hash = curr_entry_ptr->hash; - retval = (*func)(key, curr_entry_ptr->record, arg, 0); - if (rebuilds_num != tab->rebuilds_num) { -+ retry: - entries = tab->entries; - packed_p = tab->bins == NULL; - if (packed_p) { - i = find_entry(tab, hash, key); -+ if (EXPECT(i == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - error_p = i == UNDEFINED_ENTRY_IND; - } - else { - i = find_table_entry_ind(tab, hash, key); -+ if (EXPECT(i == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto retry; - error_p = i == UNDEFINED_ENTRY_IND; - i -= ENTRY_BASE; - } -@@ -1512,36 +1598,44 @@ st_general_foreach(st_table *tab, int (*func)(ANYARGS), st_data_t arg, - } - switch (retval) { - case ST_CONTINUE: -- break; -+ break; - case ST_CHECK: -- if (check_p) -- break; -+ if (check_p) -+ break; - case ST_STOP: - #ifdef ST_DEBUG -- st_check(tab); --#endif -- return 0; -- case ST_DELETE: -- if (packed_p) { -- bin = find_entry(tab, hash, curr_entry_ptr->key); -- if (bin == UNDEFINED_ENTRY_IND) -- break; -- } -- else { -- bin_ind = find_table_bin_ind(tab, hash, curr_entry_ptr->key); -- if (bin_ind == UNDEFINED_BIN_IND) -- break; -- bin = get_bin(tab->bins, get_size_ind(tab), bin_ind) - ENTRY_BASE; -- MARK_BIN_DELETED(tab, bin_ind); -- } -- st_assert(&entries[bin] == curr_entry_ptr); -- MARK_ENTRY_DELETED(curr_entry_ptr); -- tab->num_entries--; -- update_range_for_deleted(tab, bin); -+ st_check(tab); -+#endif -+ return 0; -+ case ST_DELETE: { -+ st_data_t key = curr_entry_ptr->key; -+ -+ again: -+ if (packed_p) { -+ bin = find_entry(tab, hash, key); -+ if (EXPECT(bin == REBUILT_TABLE_ENTRY_IND, 0)) -+ goto again; -+ if (bin == UNDEFINED_ENTRY_IND) -+ break; -+ } -+ else { -+ bin_ind = find_table_bin_ind(tab, hash, key); -+ if (EXPECT(bin_ind == REBUILT_TABLE_BIN_IND, 0)) -+ goto again; -+ if (bin_ind == UNDEFINED_BIN_IND) -+ break; -+ bin = get_bin(tab->bins, get_size_ind(tab), bin_ind) - ENTRY_BASE; -+ MARK_BIN_DELETED(tab, bin_ind); -+ } -+ curr_entry_ptr = &entries[bin]; -+ MARK_ENTRY_DELETED(curr_entry_ptr); -+ tab->num_entries--; -+ update_range_for_deleted(tab, bin); - #ifdef ST_DEBUG -- st_check(tab); -+ st_check(tab); - #endif -- break; -+ break; -+ } - } - } - #ifdef ST_DEBUG -@@ -2015,10 +2109,12 @@ st_expand_table(st_table *tab, st_index_t siz) - free(tmp); - } - --/* Rehash using linear search. */ --static void -+/* Rehash using linear search. Return TRUE if we found that the table -+ was rebuilt. */ -+static int - st_rehash_linear(st_table *tab) - { -+ int eq_p, rebuilt_p; - st_index_t i, j; - st_table_entry *p, *q; - if (tab->bins) { -@@ -2033,7 +2129,10 @@ st_rehash_linear(st_table *tab) - q = &tab->entries[j]; - if (DELETED_ENTRY_P(q)) - continue; -- if (PTR_EQUAL(tab, p, q->hash, q->key)) { -+ DO_PTR_EQUAL_CHECK(tab, p, q->hash, q->key, eq_p, rebuilt_p); -+ if (EXPECT(rebuilt_p, 0)) -+ return TRUE; -+ if (eq_p) { - st_assert(p < q); - *p = *q; - MARK_ENTRY_DELETED(q); -@@ -2042,12 +2141,15 @@ st_rehash_linear(st_table *tab) - } - } - } -+ return FALSE; - } - --/* Rehash using index */ --static void -+/* Rehash using index. Return TRUE if we found that the table was -+ rebuilt. */ -+static int - st_rehash_indexed(st_table *tab) - { -+ int eq_p, rebuilt_p; - st_index_t i; - st_index_t const n = bins_size(tab); - unsigned int const size_ind = get_size_ind(tab); -@@ -2076,26 +2178,32 @@ st_rehash_indexed(st_table *tab) - set_bin(bins, size_ind, ind, i + ENTRY_BASE); - break; - } -- else if (PTR_EQUAL(tab, q, p->hash, p->key)) { -- /* duplicated key; delete it */ -- st_assert(q < p); -- q->record = p->record; -- MARK_ENTRY_DELETED(p); -- tab->num_entries--; -- update_range_for_deleted(tab, bin); -- break; -- } - else { -- /* hash collision; skip it */ -+ DO_PTR_EQUAL_CHECK(tab, q, p->hash, p->key, eq_p, rebuilt_p); -+ if (EXPECT(rebuilt_p, 0)) -+ return TRUE; -+ if (eq_p) { -+ /* duplicated key; delete it */ -+ st_assert(q < p); -+ q->record = p->record; -+ MARK_ENTRY_DELETED(p); -+ tab->num_entries--; -+ update_range_for_deleted(tab, bin); -+ break; -+ } -+ else { -+ /* hash collision; skip it */ - #ifdef QUADRATIC_PROBE -- ind = hash_bin(ind + d, tab); -- d++; -+ ind = hash_bin(ind + d, tab); -+ d++; - #else -- ind = secondary_hash(ind, tab, &peterb); -+ ind = secondary_hash(ind, tab, &peterb); - #endif -- } -+ } -+ } - } - } -+ return FALSE; - } - - /* Reconstruct TAB's bins according to TAB's entries. This function -@@ -2104,10 +2212,14 @@ st_rehash_indexed(st_table *tab) - static void - st_rehash(st_table *tab) - { -- if (tab->bin_power <= MAX_POWER2_FOR_TABLES_WITHOUT_BINS) -- st_rehash_linear(tab); -- else -- st_rehash_indexed(tab); -+ int rebuilt_p; -+ -+ do { -+ if (tab->bin_power <= MAX_POWER2_FOR_TABLES_WITHOUT_BINS) -+ rebuilt_p = st_rehash_linear(tab); -+ else -+ rebuilt_p = st_rehash_indexed(tab); -+ } while (rebuilt_p); - } - - #ifdef RUBY --- -2.16.1 - diff --git a/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch b/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch new file mode 100644 index 0000000..fa5ad3e --- /dev/null +++ b/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch @@ -0,0 +1,115 @@ +From 584b5929f9b769c4d0b03e322a9fddf2b2dd3454 Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sun, 1 Apr 2018 13:02:11 +0000 +Subject: [PATCH] test_time_tz.rb: Kiritimati tzdata fix + +* test/ruby/test_time_tz.rb (gen_zdump_test): fix the expected + data at the Kiritimati's skip of New Year's Eve 1994. + [Bug #14655] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/ruby/test_time_tz.rb | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb +index dfe139033ed3..ac5f81892878 100644 +--- a/test/ruby/test_time_tz.rb ++++ b/test/ruby/test_time_tz.rb +@@ -364,9 +364,18 @@ def self.gen_zdump_test(data) + Europe/London Sun Aug 10 01:00:00 1947 UTC = Sun Aug 10 02:00:00 1947 BST isdst=1 gmtoff=3600 + Europe/London Sun Nov 2 01:59:59 1947 UTC = Sun Nov 2 02:59:59 1947 BST isdst=1 gmtoff=3600 + Europe/London Sun Nov 2 02:00:00 1947 UTC = Sun Nov 2 02:00:00 1947 GMT isdst=0 gmtoff=0 ++End ++ if CORRECT_KIRITIMATI_SKIP_1994 ++ gen_zdump_test <<'End' ++Pacific/Kiritimati Sat Dec 31 09:59:59 1994 UTC = Fri Dec 30 23:59:59 1994 LINT isdst=0 gmtoff=-36000 ++Pacific/Kiritimati Sat Dec 31 10:00:00 1994 UTC = Sun Jan 1 00:00:00 1995 LINT isdst=0 gmtoff=50400 ++End ++ else ++ gen_zdump_test <<'End' + Pacific/Kiritimati Sun Jan 1 09:59:59 1995 UTC = Sat Dec 31 23:59:59 1994 LINT isdst=0 gmtoff=-36000 + Pacific/Kiritimati Sun Jan 1 10:00:00 1995 UTC = Mon Jan 2 00:00:00 1995 LINT isdst=0 gmtoff=50400 + End ++ end + gen_zdump_test <<'End' if has_right_tz + right/America/Los_Angeles Fri Jun 30 23:59:60 1972 UTC = Fri Jun 30 16:59:60 1972 PDT isdst=1 gmtoff=-25200 + right/America/Los_Angeles Wed Dec 31 23:59:60 2008 UTC = Wed Dec 31 15:59:60 2008 PST isdst=0 gmtoff=-28800 +-- + +From 2965c2d4df78e6f5acf8759f84c88ce14a4e70f1 Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sun, 1 Apr 2018 02:00:36 +0000 +Subject: [PATCH] test_time_tz.rb: Kiritimati tzdata fix + +* test/ruby/test_time_tz.rb (TestTimeTZ#test_pacific_kiritimati): + fix the expected data at the skip of New Year's Eve 1994. + [Bug #14655] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/ruby/test_time_tz.rb | 17 ++++++++++++++--- + 1 file changed, 14 insertions(+), 3 deletions(-) + +diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb +index 39b830d28a3d..dfe139033ed3 100644 +--- a/test/ruby/test_time_tz.rb ++++ b/test/ruby/test_time_tz.rb +@@ -89,6 +89,9 @@ def group_by(e, &block) + Time.local(1951, 5, 6, 1, 0, 0).dst? # DST with fixed tzdata + end + } ++ CORRECT_KIRITIMATI_SKIP_1994 = with_tz("Pacific/Kiritimati") { ++ Time.local(1994, 12, 31, 0, 0, 0).year == 1995 ++ } + + def time_to_s(t) + t.to_s +@@ -178,9 +181,17 @@ def test_europe_lisbon + + def test_pacific_kiritimati + with_tz(tz="Pacific/Kiritimati") { +- assert_time_constructor(tz, "1994-12-31 23:59:59 -1000", :local, [1994,12,31,23,59,59]) +- assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,1,0,0,0]) +- assert_time_constructor(tz, "1995-01-02 23:59:59 +1400", :local, [1995,1,1,23,59,59]) ++ assert_time_constructor(tz, "1994-12-30 00:00:00 -1000", :local, [1994,12,30,0,0,0]) ++ assert_time_constructor(tz, "1994-12-30 23:59:59 -1000", :local, [1994,12,30,23,59,59]) ++ if CORRECT_KIRITIMATI_SKIP_1994 ++ assert_time_constructor(tz, "1995-01-01 00:00:00 +1400", :local, [1994,12,31,0,0,0]) ++ assert_time_constructor(tz, "1995-01-01 23:59:59 +1400", :local, [1994,12,31,23,59,59]) ++ assert_time_constructor(tz, "1995-01-01 00:00:00 +1400", :local, [1995,1,1,0,0,0]) ++ else ++ assert_time_constructor(tz, "1994-12-31 23:59:59 -1000", :local, [1994,12,31,23,59,59]) ++ assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,1,0,0,0]) ++ assert_time_constructor(tz, "1995-01-02 23:59:59 +1400", :local, [1995,1,1,23,59,59]) ++ end + assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,2,0,0,0]) + } + end +-- + +From a0e6607a8172f9eaf9a15f03065736deb2035771 Mon Sep 17 00:00:00 2001 +From: nobu +Date: Sun, 1 Apr 2018 13:16:14 +0000 +Subject: [PATCH] test_time_tz.rb: Lisbon tzdata fix + +* test/ruby/test_time_tz.rb (gen_variational_zdump_test): Update + Lisbon zdump data, which fixed the 1912-01-01 transition for + Portugual and its colonies. [Bug #14655] + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/ruby/test_time_tz.rb | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb +index ac5f81892878..b32caff9c539 100644 +--- a/test/ruby/test_time_tz.rb ++++ b/test/ruby/test_time_tz.rb +@@ -434,5 +434,6 @@ def self.gen_variational_zdump_test(hint, data) + gen_variational_zdump_test "lisbon", <<'End' if has_lisbon_tz + Europe/Lisbon Mon Jan 1 00:36:31 1912 UTC = Sun Dec 31 23:59:59 1911 LMT isdst=0 gmtoff=-2192 + Europe/Lisbon Mon Jan 1 00:36:44 1912 UT = Sun Dec 31 23:59:59 1911 LMT isdst=0 gmtoff=-2205 ++Europe/Lisbon Sun Dec 31 23:59:59 1911 UT = Sun Dec 31 23:23:14 1911 LMT isdst=0 gmtoff=-2205 + End + end diff --git a/ruby.spec b/ruby.spec index 3c6aea5..757cc97 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,6 +1,6 @@ %global major_version 2 %global minor_version 5 -%global teeny_version 0 +%global teeny_version 1 %global major_minor_version %{major_version}.%{minor_version} %global ruby_version %{major_minor_version}.%{teeny_version} @@ -21,7 +21,7 @@ %endif -%global release 90 +%global release 92 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory three, since the @@ -135,19 +135,9 @@ Patch9: ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch # Add Gem.operating_system_defaults to allow packagers to override defaults. # https://github.com/rubygems/rubygems/pull/2116 Patch10: ruby-2.5.0-Add-Gem.operating_system_defaults.patch -# Fix segfault during generating documentation. -# https://bugs.ruby-lang.org/issues/14343 -Patch11: ruby-2.5.0-parse.y-assignable_error.patch -# Recent tzdata change breaks Ruby test suite. -# https://bugs.ruby-lang.org/issues/14438 -Patch12: ruby-2.5.0-Disable-Tokyo-TZ-tests.patch -# Fix thread_safe tests suite segfaults. -# https://bugs.ruby-lang.org/issues/14357 -Patch13: ruby-2.5.0-st.c-retry-operations-if-rebuilt.patch -# Fix: Multiple vulnerabilities in RubyGems -# https://bugzilla.redhat.com/show_bug.cgi?id=1547431 -# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/ -Patch14: rubygems-2.5.0-multiple-vulnerabilities.patch +# TestTimeTZ test failures Kiritimati and Lisbon +# https://bugs.ruby-lang.org/issues/14655 +Patch11: ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -532,9 +522,6 @@ rm -rf ext/fiddle/libffi* %patch9 -p1 %patch10 -p1 %patch11 -p1 -%patch12 -p1 -%patch13 -p1 -%patch14 -p0 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -750,10 +737,6 @@ make runruby TESTRUN_SCRIPT="--enable-gems %{SOURCE13}" DISABLE_TESTS="" -# https://bugs.ruby-lang.org/issues/11480 -# Once seen: http://koji.fedoraproject.org/koji/taskinfo?taskID=12556650 -DISABLE_TESTS="$DISABLE_TESTS -x test_fork.rb" - # SIGSEV handler does not provide correct output on AArch64. # https://bugs.ruby-lang.org/issues/13758 %ifarch aarch64 @@ -1084,6 +1067,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Thu Mar 29 2018 Pavel Valena - 2.5.1-92 +- Update to Ruby 2.5.1. + * Thu Mar 01 2018 Vít Ondruch - 2.5.0-90 - Drop GMP dependency. diff --git a/rubygems-2.5.0-multiple-vulnerabilities.patch b/rubygems-2.5.0-multiple-vulnerabilities.patch deleted file mode 100644 index e32926a..0000000 --- a/rubygems-2.5.0-multiple-vulnerabilities.patch +++ /dev/null @@ -1,2349 +0,0 @@ -diff --git lib/rubygems.rb lib/rubygems.rb -index 0475ced164..2762bfcb88 100644 ---- lib/rubygems.rb -+++ lib/rubygems.rb -@@ -10,7 +10,7 @@ - require 'thread' - - module Gem -- VERSION = "2.7.3" -+ VERSION = "2.7.6" - end - - # Must be first since it unloads the prelude from 1.9.2 -@@ -161,7 +161,7 @@ module Gem - # these are defined in Ruby 1.8.7, hence the need for this convoluted setup. - - READ_BINARY_ERRORS = begin -- read_binary_errors = [Errno::EACCES, Errno::EROFS] -+ read_binary_errors = [Errno::EACCES, Errno::EROFS, Errno::ENOSYS] - read_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP) - read_binary_errors - end.freeze -@@ -171,7 +171,7 @@ module Gem - # these are defined in Ruby 1.8.7. - - WRITE_BINARY_ERRORS = begin -- write_binary_errors = [] -+ write_binary_errors = [Errno::ENOSYS] - write_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP) - write_binary_errors - end.freeze -@@ -871,19 +871,19 @@ def self.refresh - # Safely read a file in binary mode on all platforms. - - def self.read_binary(path) -- open path, 'rb+' do |f| -+ File.open path, 'rb+' do |f| - f.flock(File::LOCK_EX) - f.read - end - rescue *READ_BINARY_ERRORS -- open path, 'rb' do |f| -+ File.open path, 'rb' do |f| - f.read - end - rescue Errno::ENOLCK # NFS - if Thread.main != Thread.current - raise - else -- open path, 'rb' do |f| -+ File.open path, 'rb' do |f| - f.read - end - end -diff --git lib/rubygems/commands/generate_index_command.rb lib/rubygems/commands/generate_index_command.rb -index 01f1f88405..0b677b73a9 100644 ---- lib/rubygems/commands/generate_index_command.rb -+++ lib/rubygems/commands/generate_index_command.rb -@@ -68,7 +68,7 @@ def execute - - if not File.exist?(options[:directory]) or - not File.directory?(options[:directory]) then -- alert_error "unknown directory name #{directory}." -+ alert_error "unknown directory name #{options[:directory]}." - terminate_interaction 1 - else - indexer = Gem::Indexer.new options.delete(:directory), options -diff --git lib/rubygems/commands/owner_command.rb lib/rubygems/commands/owner_command.rb -index 8e2271657a..637b5bdc4d 100644 ---- lib/rubygems/commands/owner_command.rb -+++ lib/rubygems/commands/owner_command.rb -@@ -64,7 +64,7 @@ def show_owners name - end - - with_response response do |resp| -- owners = YAML.load resp.body -+ owners = Gem::SafeYAML.load resp.body - - say "Owners for gem: #{name}" - owners.each do |owner| -diff --git lib/rubygems/commands/setup_command.rb lib/rubygems/commands/setup_command.rb -index 5d1414d102..6966cde01a 100644 ---- lib/rubygems/commands/setup_command.rb -+++ lib/rubygems/commands/setup_command.rb -@@ -350,7 +350,9 @@ def fake_spec.full_gem_path - def install_default_bundler_gem - return unless Gem::USE_BUNDLER_FOR_GEMDEPS - -- mkdir_p Gem::Specification.default_specifications_dir -+ specs_dir = Gem::Specification.default_specifications_dir -+ File.join(options[:destdir], specs_dir) unless Gem.win_platform? -+ mkdir_p specs_dir - - # Workaround for non-git environment. - gemspec = File.open('bundler/bundler.gemspec', 'rb'){|f| f.read.gsub(/`git ls-files -z`/, "''") } -@@ -359,23 +361,36 @@ def install_default_bundler_gem - bundler_spec = Gem::Specification.load("bundler/bundler.gemspec") - bundler_spec.files = Dir.chdir("bundler") { Dir["{*.md,{lib,exe,man}/**/*}"] } - bundler_spec.executables -= %w[bundler bundle_ruby] -- Dir.entries(Gem::Specification.default_specifications_dir). -+ -+ # Remove bundler-*.gemspec in default specification directory. -+ Dir.entries(specs_dir). - select {|gs| gs.start_with?("bundler-") }. -- each {|gs| File.delete(File.join(Gem::Specification.default_specifications_dir, gs)) } -+ each {|gs| File.delete(File.join(specs_dir, gs)) } - -- default_spec_path = File.join(Gem::Specification.default_specifications_dir, "#{bundler_spec.full_name}.gemspec") -+ default_spec_path = File.join(specs_dir, "#{bundler_spec.full_name}.gemspec") - Gem.write_binary(default_spec_path, bundler_spec.to_ruby) - - bundler_spec = Gem::Specification.load(default_spec_path) - -+ # Remove gemspec that was same version of vendored bundler. -+ normal_gemspec = File.join(Gem.default_dir, "specifications", "bundler-#{bundler_spec.version}.gemspec") -+ if File.file? normal_gemspec -+ File.delete normal_gemspec -+ end -+ -+ # Remove gem files that were same version of vendored bundler. - if File.directory? bundler_spec.gems_dir - Dir.entries(bundler_spec.gems_dir). -- select {|default_gem| File.basename(default_gem).match(/^bundler-#{Gem::Version::VERSION_PATTERN}$/) }. -+ select {|default_gem| File.basename(default_gem) == "bundler-#{bundler_spec.version}" }. - each {|default_gem| rm_r File.join(bundler_spec.gems_dir, default_gem) } - end - -- mkdir_p bundler_spec.bin_dir -- bundler_spec.executables.each {|e| cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_spec.bin_dir, e) } -+ bundler_bin_dir = File.join(Gem.default_dir, 'gems', bundler_spec.full_name, bundler_spec.bindir) -+ File.join(options[:destdir], bundler_bin_dir) unless Gem.win_platform? -+ mkdir_p bundler_bin_dir -+ bundler_spec.executables.each do |e| -+ cp File.join("bundler", bundler_spec.bindir, e), File.join(bundler_bin_dir, e) -+ end - - if Gem.win_platform? - require 'rubygems/installer' -diff --git lib/rubygems/commands/unpack_command.rb lib/rubygems/commands/unpack_command.rb -index eb7f550673..b873f20d28 100644 ---- lib/rubygems/commands/unpack_command.rb -+++ lib/rubygems/commands/unpack_command.rb -@@ -94,7 +94,7 @@ def execute - - spec_file = File.basename spec.spec_file - -- open spec_file, 'w' do |io| -+ File.open spec_file, 'w' do |io| - io.write metadata - end - else -@@ -176,7 +176,7 @@ def get_metadata path, security_policy = nil - - metadata = nil - -- open path, Gem.binary_mode do |io| -+ File.open path, Gem.binary_mode do |io| - tar = Gem::Package::TarReader.new io - tar.each_entry do |entry| - case entry.full_name -diff --git lib/rubygems/config_file.rb lib/rubygems/config_file.rb -index a4efed0f5a..c0d19dbfc2 100644 ---- lib/rubygems/config_file.rb -+++ lib/rubygems/config_file.rb -@@ -458,7 +458,7 @@ def to_yaml # :nodoc: - - # Writes out this config file, replacing its source. - def write -- open config_file_name, 'w' do |io| -+ File.open config_file_name, 'w' do |io| - io.write to_yaml - end - end -diff --git lib/rubygems/ext/builder.rb lib/rubygems/ext/builder.rb -index a1619c97d7..eb9db199d5 100644 ---- lib/rubygems/ext/builder.rb -+++ lib/rubygems/ext/builder.rb -@@ -212,7 +212,7 @@ def write_gem_make_out output # :nodoc: - - FileUtils.mkdir_p @spec.extension_dir - -- open destination, 'wb' do |io| io.puts output end -+ File.open destination, 'wb' do |io| io.puts output end - - destination - end -diff --git lib/rubygems/indexer.rb lib/rubygems/indexer.rb -index 871cc09d8d..3ea994414b 100644 ---- lib/rubygems/indexer.rb -+++ lib/rubygems/indexer.rb -@@ -2,6 +2,7 @@ - require 'rubygems' - require 'rubygems/package' - require 'time' -+require 'tmpdir' - - begin - gem 'builder' -@@ -64,7 +65,7 @@ def initialize(directory, options = {}) - @build_modern = options[:build_modern] - - @dest_directory = directory -- @directory = File.join(Dir.tmpdir, "gem_generate_index_#{$$}") -+ @directory = Dir.mktmpdir 'gem_generate_index' - - marshal_name = "Marshal.#{Gem.marshal_version}" - -@@ -123,7 +124,7 @@ def build_marshal_gemspecs specs - marshal_name = File.join @quick_marshal_dir, spec_file_name - - marshal_zipped = Gem.deflate Marshal.dump(spec) -- open marshal_name, 'wb' do |io| io.write marshal_zipped end -+ File.open marshal_name, 'wb' do |io| io.write marshal_zipped end - - files << marshal_name - -@@ -261,7 +262,7 @@ def compress(filename, extension) - - zipped = Gem.deflate data - -- open "#{filename}.#{extension}", 'wb' do |io| -+ File.open "#{filename}.#{extension}", 'wb' do |io| - io.write zipped - end - end -@@ -427,7 +428,7 @@ def update_specs_index(index, source, dest) - - specs_index = compact_specs specs_index.uniq.sort - -- open dest, 'wb' do |io| -+ File.open dest, 'wb' do |io| - Marshal.dump specs_index, io - end - end -diff --git lib/rubygems/installer.rb lib/rubygems/installer.rb -index 0cbca0791b..ee5fedeb64 100644 ---- lib/rubygems/installer.rb -+++ lib/rubygems/installer.rb -@@ -206,7 +206,7 @@ def check_executable_overwrite filename # :nodoc: - ruby_executable = false - existing = nil - -- open generated_bin, 'rb' do |io| -+ File.open generated_bin, 'rb' do |io| - next unless io.gets =~ /^#!/ # shebang - io.gets # blankline - -@@ -427,7 +427,7 @@ def default_spec_file - # specifications directory. - - def write_spec -- open spec_file, 'w' do |file| -+ File.open spec_file, 'w' do |file| - spec.installed_by_version = Gem.rubygems_version - - file.puts spec.to_ruby_for_cache -@@ -464,7 +464,12 @@ def generate_windows_script(filename, bindir) - def generate_bin # :nodoc: - return if spec.executables.nil? or spec.executables.empty? - -- Dir.mkdir @bin_dir unless File.exist? @bin_dir -+ begin -+ Dir.mkdir @bin_dir -+ rescue SystemCallError -+ raise unless File.directory? @bin_dir -+ end -+ - raise Gem::FilePermissionError.new(@bin_dir) unless File.writable? @bin_dir - - spec.executables.each do |filename| -@@ -863,7 +868,7 @@ def write_build_info_file - - build_info_file = File.join build_info_dir, "#{spec.full_name}.info" - -- open build_info_file, 'w' do |io| -+ File.open build_info_file, 'w' do |io| - @build_args.each do |arg| - io.puts arg - end -diff --git lib/rubygems/package.rb lib/rubygems/package.rb -index 77811ed5ec..b924122827 100644 ---- lib/rubygems/package.rb -+++ lib/rubygems/package.rb -@@ -219,7 +219,7 @@ def add_files tar # :nodoc: - next unless stat.file? - - tar.add_file_simple file, stat.mode, stat.size do |dst_io| -- open file, 'rb' do |src_io| -+ File.open file, 'rb' do |src_io| - dst_io.write src_io.read 16384 until src_io.eof? - end - end -@@ -378,9 +378,9 @@ def extract_tar_gz io, destination_dir, pattern = "*" # :nodoc: - File.dirname destination - end - -- FileUtils.mkdir_p mkdir, mkdir_options -+ mkdir_p_safe mkdir, mkdir_options, destination_dir, entry.full_name - -- open destination, 'wb' do |out| -+ File.open destination, 'wb' do |out| - out.write entry.read - FileUtils.chmod entry.header.mode, destination - end if entry.file? -@@ -416,20 +416,35 @@ def install_location filename, destination_dir # :nodoc: - raise Gem::Package::PathError.new(filename, destination_dir) if - filename.start_with? '/' - -- destination_dir = File.realpath destination_dir if -- File.respond_to? :realpath -+ destination_dir = realpath destination_dir - destination_dir = File.expand_path destination_dir - - destination = File.join destination_dir, filename - destination = File.expand_path destination - - raise Gem::Package::PathError.new(destination, destination_dir) unless -- destination.start_with? destination_dir -+ destination.start_with? destination_dir + '/' - - destination.untaint - destination - end - -+ def mkdir_p_safe mkdir, mkdir_options, destination_dir, file_name -+ destination_dir = realpath File.expand_path(destination_dir) -+ parts = mkdir.split(File::SEPARATOR) -+ parts.reduce do |path, basename| -+ path = realpath path unless path == "" -+ path = File.expand_path(path + File::SEPARATOR + basename) -+ lstat = File.lstat path rescue nil -+ if !lstat || !lstat.directory? -+ unless path.start_with? destination_dir and (FileUtils.mkdir path, mkdir_options rescue false) -+ raise Gem::Package::PathError.new(file_name, destination_dir) -+ end -+ end -+ path -+ end -+ end -+ - ## - # Loads a Gem::Specification from the TarEntry +entry+ - -@@ -603,6 +618,10 @@ def verify_files gem - raise Gem::Package::FormatError.new \ - 'package content (data.tar.gz) is missing', @gem - end -+ -+ if duplicates = @files.group_by {|f| f }.select {|k,v| v.size > 1 }.map(&:first) and duplicates.any? -+ raise Gem::Security::Exception, "duplicate files in the package: (#{duplicates.map(&:inspect).join(', ')})" -+ end - end - - ## -@@ -616,6 +635,16 @@ def verify_gz entry # :nodoc: - raise Gem::Package::FormatError.new(e.message, entry.full_name) - end - -+ if File.respond_to? :realpath -+ def realpath file -+ File.realpath file -+ end -+ else -+ def realpath file -+ file -+ end -+ end -+ - end - - require 'rubygems/package/digest_io' -diff --git lib/rubygems/package/file_source.rb lib/rubygems/package/file_source.rb -index 1a4dc4c824..ecc3a68677 100644 ---- lib/rubygems/package/file_source.rb -+++ lib/rubygems/package/file_source.rb -@@ -23,11 +23,11 @@ def present? - end - - def with_write_io &block -- open path, 'wb', &block -+ File.open path, 'wb', &block - end - - def with_read_io &block -- open path, 'rb', &block -+ File.open path, 'rb', &block - end - - end -diff --git lib/rubygems/package/old.rb lib/rubygems/package/old.rb -index f6e6e67c38..322d682ca8 100644 ---- lib/rubygems/package/old.rb -+++ lib/rubygems/package/old.rb -@@ -80,7 +80,7 @@ def extract_files destination_dir - - FileUtils.mkdir_p File.dirname destination - -- open destination, 'wb', entry['mode'] do |out| -+ File.open destination, 'wb', entry['mode'] do |out| - out.write file_data - end - -diff --git lib/rubygems/package/tar_header.rb lib/rubygems/package/tar_header.rb -index c54bd14d57..d557357114 100644 ---- lib/rubygems/package/tar_header.rb -+++ lib/rubygems/package/tar_header.rb -@@ -104,25 +104,30 @@ def self.from(stream) - fields = header.unpack UNPACK_FORMAT - - new :name => fields.shift, -- :mode => fields.shift.oct, -- :uid => fields.shift.oct, -- :gid => fields.shift.oct, -- :size => fields.shift.oct, -- :mtime => fields.shift.oct, -- :checksum => fields.shift.oct, -+ :mode => strict_oct(fields.shift), -+ :uid => strict_oct(fields.shift), -+ :gid => strict_oct(fields.shift), -+ :size => strict_oct(fields.shift), -+ :mtime => strict_oct(fields.shift), -+ :checksum => strict_oct(fields.shift), - :typeflag => fields.shift, - :linkname => fields.shift, - :magic => fields.shift, -- :version => fields.shift.oct, -+ :version => strict_oct(fields.shift), - :uname => fields.shift, - :gname => fields.shift, -- :devmajor => fields.shift.oct, -- :devminor => fields.shift.oct, -+ :devmajor => strict_oct(fields.shift), -+ :devminor => strict_oct(fields.shift), - :prefix => fields.shift, - - :empty => empty - end - -+ def self.strict_oct(str) -+ return str.oct if str =~ /\A[0-7]*\z/ -+ raise ArgumentError, "#{str.inspect} is not an octal string" -+ end -+ - ## - # Creates a new TarHeader using +vals+ - -diff --git lib/rubygems/package/tar_writer.rb lib/rubygems/package/tar_writer.rb -index f68b8d4c5e..390f7851a3 100644 ---- lib/rubygems/package/tar_writer.rb -+++ lib/rubygems/package/tar_writer.rb -@@ -196,6 +196,8 @@ def add_file_signed name, mode, signer - digest_name == signer.digest_name - end - -+ raise "no #{signer.digest_name} in #{digests.values.compact}" unless signature_digest -+ - if signer.key then - signature = signer.sign signature_digest.digest - -diff --git lib/rubygems/request_set/lockfile.rb lib/rubygems/request_set/lockfile.rb -index 7f6eadb939..76ad17d486 100644 ---- lib/rubygems/request_set/lockfile.rb -+++ lib/rubygems/request_set/lockfile.rb -@@ -223,7 +223,7 @@ def to_s - def write - content = to_s - -- open "#{@gem_deps_file}.lock", 'w' do |io| -+ File.open "#{@gem_deps_file}.lock", 'w' do |io| - io.write content - end - end -diff --git lib/rubygems/security.rb lib/rubygems/security.rb -index 4690dd9230..236577c5a3 100644 ---- lib/rubygems/security.rb -+++ lib/rubygems/security.rb -@@ -578,7 +578,7 @@ def self.trusted_certificates &block - def self.write pemmable, path, permissions = 0600, passphrase = nil, cipher = KEY_CIPHER - path = File.expand_path path - -- open path, 'wb', permissions do |io| -+ File.open path, 'wb', permissions do |io| - if passphrase and cipher - io.write pemmable.to_pem cipher, passphrase - else -diff --git lib/rubygems/security/trust_dir.rb lib/rubygems/security/trust_dir.rb -index bf44975cc6..849cf3cd3e 100644 ---- lib/rubygems/security/trust_dir.rb -+++ lib/rubygems/security/trust_dir.rb -@@ -93,7 +93,7 @@ def trust_cert certificate - - destination = cert_path certificate - -- open destination, 'wb', @permissions[:trusted_cert] do |io| -+ File.open destination, 'wb', @permissions[:trusted_cert] do |io| - io.write certificate.to_pem - end - end -diff --git lib/rubygems/server.rb lib/rubygems/server.rb -index 93b3af36f8..62c3dfe9cf 100644 ---- lib/rubygems/server.rb -+++ lib/rubygems/server.rb -@@ -623,6 +623,18 @@ def root(req, res) - executables = nil if executables.empty? - executables.last["is_last"] = true if executables - -+ # Pre-process spec homepage for safety reasons -+ begin -+ homepage_uri = URI.parse(spec.homepage) -+ if [URI::HTTP, URI::HTTPS].member? homepage_uri.class -+ homepage_uri = spec.homepage -+ else -+ homepage_uri = "." -+ end -+ rescue URI::InvalidURIError -+ homepage_uri = "." -+ end -+ - specs << { - "authors" => spec.authors.sort.join(", "), - "date" => spec.date.to_s, -@@ -632,7 +644,7 @@ def root(req, res) - "only_one_executable" => (executables && executables.size == 1), - "full_name" => spec.full_name, - "has_deps" => !deps.empty?, -- "homepage" => spec.homepage, -+ "homepage" => homepage_uri, - "name" => spec.name, - "rdoc_installed" => Gem::RDoc.new(spec).rdoc_installed?, - "ri_installed" => Gem::RDoc.new(spec).ri_installed?, -diff --git lib/rubygems/source.rb lib/rubygems/source.rb -index bd84c217a7..b28b850660 100644 ---- lib/rubygems/source.rb -+++ lib/rubygems/source.rb -@@ -160,7 +160,7 @@ def fetch_spec name_tuple - if update_cache? then - FileUtils.mkdir_p cache_dir - -- open local_spec, 'wb' do |io| -+ File.open local_spec, 'wb' do |io| - io.write spec - end - end -diff --git lib/rubygems/specification.rb lib/rubygems/specification.rb -index efc08c4738..2560324b7a 100644 ---- lib/rubygems/specification.rb -+++ lib/rubygems/specification.rb -@@ -15,6 +15,7 @@ - require 'rubygems/stub_specification' - require 'rubygems/util/list' - require 'stringio' -+require 'uri' - - ## - # The Specification class contains the information for a Gem. Typically -@@ -2822,10 +2823,16 @@ def validate packaging = true - raise Gem::InvalidSpecificationException, "#{lazy} is not a summary" - end - -- if homepage and not homepage.empty? and -- homepage !~ /\A[a-z][a-z\d+.-]*:/i then -- raise Gem::InvalidSpecificationException, -- "\"#{homepage}\" is not a URI" -+ # Make sure a homepage is valid HTTP/HTTPS URI -+ if homepage and not homepage.empty? -+ begin -+ homepage_uri = URI.parse(homepage) -+ unless [URI::HTTP, URI::HTTPS].member? homepage_uri.class -+ raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI" -+ end -+ rescue URI::InvalidURIError -+ raise Gem::InvalidSpecificationException, "\"#{homepage}\" is not a valid HTTP URI" -+ end - end - - # Warnings -diff --git lib/rubygems/stub_specification.rb lib/rubygems/stub_specification.rb -index 8337375ab4..ae2effbc84 100644 ---- lib/rubygems/stub_specification.rb -+++ lib/rubygems/stub_specification.rb -@@ -113,6 +113,8 @@ def data - unless @data - begin - saved_lineno = $. -+ -+ # TODO It should be use `File.open`, but bundler-1.16.1 example expects Kernel#open. - open loaded_from, OPEN_MODE do |file| - begin - file.readline # discard encoding line -diff --git lib/rubygems/test_case.rb lib/rubygems/test_case.rb -index f7f216e5e3..39aa4fc9a7 100644 ---- lib/rubygems/test_case.rb -+++ lib/rubygems/test_case.rb -@@ -488,7 +488,7 @@ def git_gem name = 'a', version = 1 - - gemspec = "#{name}.gemspec" - -- open File.join(directory, gemspec), 'w' do |io| -+ File.open File.join(directory, gemspec), 'w' do |io| - io.write git_spec.to_ruby - end - -@@ -592,7 +592,7 @@ def mu_pp(obj) - # Reads a Marshal file at +path+ - - def read_cache(path) -- open path.dup.untaint, 'rb' do |io| -+ File.open path.dup.untaint, 'rb' do |io| - Marshal.load io.read - end - end -@@ -612,7 +612,7 @@ def write_file(path) - dir = File.dirname path - FileUtils.mkdir_p dir unless File.directory? dir - -- open path, 'wb' do |io| -+ File.open path, 'wb' do |io| - yield io if block_given? - end - -@@ -727,7 +727,7 @@ def install_default_gems(*specs) - install_default_specs(*specs) - - specs.each do |spec| -- open spec.loaded_from, 'w' do |io| -+ File.open spec.loaded_from, 'w' do |io| - io.write spec.to_ruby_for_cache - end - end -@@ -1363,7 +1363,7 @@ def save_gemspec name = 'a', version = 1, directory = '.' - yield specification if block_given? - end - -- open File.join(directory, "#{name}.gemspec"), 'w' do |io| -+ File.open File.join(directory, "#{name}.gemspec"), 'w' do |io| - io.write vendor_spec.to_ruby - end - -diff --git lib/rubygems/test_utilities.rb lib/rubygems/test_utilities.rb -index 686916ea02..83c9d2d0fe 100644 ---- lib/rubygems/test_utilities.rb -+++ lib/rubygems/test_utilities.rb -@@ -346,7 +346,7 @@ def spec name, version, dependencies = nil, &block - end - - def write_spec spec # :nodoc: -- open spec.spec_file, 'w' do |io| -+ File.open spec.spec_file, 'w' do |io| - io.write spec.to_ruby_for_cache - end - end -diff --git lib/rubygems/util.rb lib/rubygems/util.rb -index 2de45c900b..6c75910004 100644 ---- lib/rubygems/util.rb -+++ lib/rubygems/util.rb -@@ -114,7 +114,8 @@ def self.traverse_parents directory, &block - - here = File.expand_path directory - loop do -- Dir.chdir here, &block -+ Dir.chdir here, &block rescue Errno::EACCES -+ - new_here = File.expand_path('..', here) - return if new_here == here # toplevel - here = new_here -diff --git lib/rubygems/validator.rb lib/rubygems/validator.rb -index 83448229bb..6842e4fa9c 100644 ---- lib/rubygems/validator.rb -+++ lib/rubygems/validator.rb -@@ -34,7 +34,7 @@ def verify_gem(gem_data) - # gem_path:: [String] Path to gem file - - def verify_gem_file(gem_path) -- open gem_path, Gem.binary_mode do |file| -+ File.open gem_path, Gem.binary_mode do |file| - gem_data = file.read - verify_gem gem_data - end -@@ -109,7 +109,7 @@ def alien(gems=[]) - - good, gone, unreadable = nil, nil, nil, nil - -- open gem_path, Gem.binary_mode do |file| -+ File.open gem_path, Gem.binary_mode do |file| - package = Gem::Package.new gem_path - - good, gone = package.contents.partition { |file_name| -@@ -134,7 +134,7 @@ def alien(gems=[]) - - source = File.join gem_directory, entry['path'] - -- open source, Gem.binary_mode do |f| -+ File.open source, Gem.binary_mode do |f| - unless f.read == data then - errors[gem_name][entry['path']] = "Modified from original" - end -diff --git test/rubygems/test_gem.rb test/rubygems/test_gem.rb -index 8a11cc2ecf..183771f0f3 100644 ---- test/rubygems/test_gem.rb -+++ test/rubygems/test_gem.rb -@@ -7,7 +7,7 @@ - require 'tmpdir' - - # TODO: push this up to test_case.rb once battle tested --$SAFE=1 -+ - $LOAD_PATH.map! do |path| - path.dup.untaint - end -@@ -463,7 +463,7 @@ def test_self_ensure_gem_directories_missing_parents - assert File.directory?(util_cache_dir) - end - -- unless win_platform? then # only for FS that support write protection -+ unless win_platform? || Process.uid.zero? then # only for FS that support write protection - def test_self_ensure_gem_directories_write_protected - gemdir = File.join @tempdir, "egd" - FileUtils.rm_r gemdir rescue nil -@@ -775,7 +775,7 @@ def test_self_prefix_sitelibdir - end - - def test_self_read_binary -- open 'test', 'w' do |io| -+ File.open 'test', 'w' do |io| - io.write "\xCF\x80" - end - -@@ -1643,7 +1643,7 @@ def test_use_gemdeps - spec = Gem::Specification.find { |s| s == spec } - refute spec.activated? - -- open gem_deps_file, 'w' do |io| -+ File.open gem_deps_file, 'w' do |io| - io.write 'gem "a"' - end - -@@ -1662,7 +1662,7 @@ def test_use_gemdeps_ENV - - refute spec.activated? - -- open 'gem.deps.rb', 'w' do |io| -+ File.open 'gem.deps.rb', 'w' do |io| - io.write 'gem "a"' - end - -@@ -1706,7 +1706,7 @@ def test_use_gemdeps_automatic - - refute spec.activated? - -- open 'Gemfile', 'w' do |io| -+ File.open 'Gemfile', 'w' do |io| - io.write 'gem "a"' - end - -@@ -1735,7 +1735,7 @@ def test_use_gemdeps_disabled - - refute spec.activated? - -- open 'gem.deps.rb', 'w' do |io| -+ File.open 'gem.deps.rb', 'w' do |io| - io.write 'gem "a"' - end - -@@ -1750,7 +1750,7 @@ def test_use_gemdeps_missing_gem - skip 'Insecure operation - read' if RUBY_VERSION <= "1.8.7" - rubygems_gemdeps, ENV['RUBYGEMS_GEMDEPS'] = ENV['RUBYGEMS_GEMDEPS'], 'x' - -- open 'x', 'w' do |io| -+ File.open 'x', 'w' do |io| - io.write 'gem "a"' - end - -@@ -1791,7 +1791,7 @@ def test_use_gemdeps_specific - spec = Gem::Specification.find { |s| s == spec } - refute spec.activated? - -- open 'x', 'w' do |io| -+ File.open 'x', 'w' do |io| - io.write 'gem "a"' - end - -diff --git test/rubygems/test_gem_commands_cleanup_command.rb test/rubygems/test_gem_commands_cleanup_command.rb -index c55e195975..60d208fcc0 100644 ---- test/rubygems/test_gem_commands_cleanup_command.rb -+++ test/rubygems/test_gem_commands_cleanup_command.rb -@@ -158,7 +158,7 @@ def test_execute_all_user_no_sudo - assert_path_exists @a_1_1.gem_dir - ensure - FileUtils.chmod 0755, @gemhome -- end unless win_platform? -+ end unless win_platform? || Process.uid.zero? - - def test_execute_dry_run - @cmd.options[:args] = %w[a] -diff --git test/rubygems/test_gem_commands_install_command.rb test/rubygems/test_gem_commands_install_command.rb -index dd86a85038..822d40e3f3 100644 ---- test/rubygems/test_gem_commands_install_command.rb -+++ test/rubygems/test_gem_commands_install_command.rb -@@ -131,6 +131,7 @@ def test_execute_local_transitive_prerelease - - def test_execute_no_user_install - skip 'skipped on MS Windows (chmod has no effect)' if win_platform? -+ skip 'skipped in root privilege' if Process.uid.zero? - - specs = spec_fetcher do |fetcher| - fetcher.gem 'a', 2 -diff --git test/rubygems/test_gem_commands_owner_command.rb test/rubygems/test_gem_commands_owner_command.rb -index 44652c1093..53cac4ce87 100644 ---- test/rubygems/test_gem_commands_owner_command.rb -+++ test/rubygems/test_gem_commands_owner_command.rb -@@ -43,6 +43,31 @@ def test_show_owners - assert_match %r{- 4}, @ui.output - end - -+ def test_show_owners_dont_load_objects -+ skip "testing a psych-only API" unless defined?(::Psych::DisallowedClass) -+ -+ response = < 0 -- assert Gem::Specification.find_all_by_name('x').length == 0 -+ assert Gem::Specification.find_all_by_name('x').length.zero? - end - - def test_execute_all -diff --git test/rubygems/test_gem_dependency_installer.rb test/rubygems/test_gem_dependency_installer.rb -index e55cc75682..3d76291668 100644 ---- test/rubygems/test_gem_dependency_installer.rb -+++ test/rubygems/test_gem_dependency_installer.rb -@@ -424,7 +424,7 @@ def test_install_dependency_existing_extension - extconf_rb = File.join @gemhome, 'gems', 'e-1', 'extconf.rb' - FileUtils.mkdir_p File.dirname extconf_rb - -- open extconf_rb, 'w' do |io| -+ File.open extconf_rb, 'w' do |io| - io.write <<-EXTCONF_RB - require 'mkmf' - create_makefile 'e' -diff --git test/rubygems/test_gem_doctor.rb test/rubygems/test_gem_doctor.rb -index 39b8a11692..8db65d70ce 100644 ---- test/rubygems/test_gem_doctor.rb -+++ test/rubygems/test_gem_doctor.rb -@@ -24,7 +24,7 @@ def test_doctor - - FileUtils.rm b.spec_file - -- open c.spec_file, 'w' do |io| -+ File.open c.spec_file, 'w' do |io| - io.write 'this will raise an exception when evaluated.' - end - -@@ -77,7 +77,7 @@ def test_doctor_dry_run - - FileUtils.rm b.spec_file - -- open c.spec_file, 'w' do |io| -+ File.open c.spec_file, 'w' do |io| - io.write 'this will raise an exception when evaluated.' - end - -diff --git test/rubygems/test_gem_ext_builder.rb test/rubygems/test_gem_ext_builder.rb -index d142ef28da..3dabd3e350 100644 ---- test/rubygems/test_gem_ext_builder.rb -+++ test/rubygems/test_gem_ext_builder.rb -@@ -32,7 +32,7 @@ def test_class_make - results = [] - - Dir.chdir @ext do -- open 'Makefile', 'w' do |io| -+ File.open 'Makefile', 'w' do |io| - io.puts <<-MAKEFILE - all: - \t@#{Gem.ruby} -e "puts %Q{all: \#{ENV['DESTDIR']}}" -@@ -72,7 +72,7 @@ def test_class_make_no_clean - results = [] - - Dir.chdir @ext do -- open 'Makefile', 'w' do |io| -+ File.open 'Makefile', 'w' do |io| - io.puts <<-MAKEFILE - all: - \t@#{Gem.ruby} -e "puts %Q{all: \#{ENV['DESTDIR']}}" -@@ -107,7 +107,7 @@ def test_build_extensions - - extconf_rb = File.join ext_dir, 'extconf.rb' - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' - require 'mkmf' - -@@ -168,7 +168,7 @@ def Gem.install_extension_in_lib - - extconf_rb = File.join ext_dir, 'extconf.rb' - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' - require 'mkmf' - -@@ -290,7 +290,7 @@ def test_build_extensions_with_build_args - - FileUtils.mkdir_p @spec.gem_dir - -- open File.join(@spec.gem_dir, "extconf.rb"), "w" do |f| -+ File.open File.join(@spec.gem_dir, "extconf.rb"), "w" do |f| - f.write <<-'RUBY' - puts "IN EXTCONF" - extconf_args = File.join File.dirname(__FILE__), 'extconf_args' -@@ -323,7 +323,7 @@ def test_initialize - - build_info_file = File.join build_info_dir, "#{@spec.full_name}.info" - -- open build_info_file, 'w' do |io| -+ File.open build_info_file, 'w' do |io| - io.puts '--with-foo-dir=/nonexistent' - end - -diff --git test/rubygems/test_gem_gem_runner.rb test/rubygems/test_gem_gem_runner.rb -index 0a1faa404a..d68ac4da81 100644 ---- test/rubygems/test_gem_gem_runner.rb -+++ test/rubygems/test_gem_gem_runner.rb -@@ -1,38 +1,6 @@ - # frozen_string_literal: true - require 'rubygems/test_case' --begin -- gem_home_files = lambda{ -- if Dir.exist?(ENV["GEM_HOME"]) -- require "find" -- ary = Find.find(ENV["GEM_HOME"]).to_a -- else -- [] -- end -- } -- prev_gem_home = ENV["GEM_HOME"] -- prev_gem_home_files = gem_home_files.call -- prev_threads = Thread.list.map{|e| e.inspect} -- -- require 'rubygems/gem_runner' --ensure -- if $! -- msg = < 'KEY' } - FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path - -- open Gem.configuration.credentials_path, 'w' do |f| -+ File.open Gem.configuration.credentials_path, 'w' do |f| - f.write keys.to_yaml - end - -@@ -59,7 +59,7 @@ def test_api_key_override - keys = { :rubygems_api_key => 'KEY', :other => 'OTHER' } - FileUtils.mkdir_p File.dirname Gem.configuration.credentials_path - -- open Gem.configuration.credentials_path, 'w' do |f| -+ File.open Gem.configuration.credentials_path, 'w' do |f| - f.write keys.to_yaml - end - -@@ -163,7 +163,7 @@ def test_sign_in_with_other_credentials_doesnt_overwrite_other_keys - other_api_key = 'f46dbb18bb6a9c97cdc61b5b85c186a17403cdcbf' - - FileUtils.mkdir_p File.dirname(Gem.configuration.credentials_path) -- open Gem.configuration.credentials_path, 'w' do |f| -+ File.open Gem.configuration.credentials_path, 'w' do |f| - f.write Hash[:other_api_key, other_api_key].to_yaml - end - util_sign_in [api_key, 200, 'OK'] -diff --git test/rubygems/test_gem_indexer.rb test/rubygems/test_gem_indexer.rb -index a4a966e8de..5a9075e676 100644 ---- test/rubygems/test_gem_indexer.rb -+++ test/rubygems/test_gem_indexer.rb -@@ -39,8 +39,7 @@ def setup - - def test_initialize - assert_equal @tempdir, @indexer.dest_directory -- assert_equal File.join(Dir.tmpdir, "gem_generate_index_#{$$}"), -- @indexer.directory -+ assert_match %r{#{Dir.mktmpdir('gem_generate_index').match(/.*-/)}}, @indexer.directory - - indexer = Gem::Indexer.new @tempdir - assert indexer.build_modern -diff --git test/rubygems/test_gem_install_update_options.rb test/rubygems/test_gem_install_update_options.rb -index e2d546307d..371e408d27 100644 ---- test/rubygems/test_gem_install_update_options.rb -+++ test/rubygems/test_gem_install_update_options.rb -@@ -141,6 +141,8 @@ def test_user_install_enabled - def test_user_install_disabled_read_only - if win_platform? - skip('test_user_install_disabled_read_only test skipped on MS Windows') -+ elsif Process.uid.zero? -+ skip('test_user_install_disabled_read_only test skipped in root privilege') - else - @cmd.handle_options %w[--no-user-install] - -diff --git test/rubygems/test_gem_installer.rb test/rubygems/test_gem_installer.rb -index 39095c7dee..93b0482407 100644 ---- test/rubygems/test_gem_installer.rb -+++ test/rubygems/test_gem_installer.rb -@@ -140,7 +140,7 @@ def test_check_executable_overwrite_format_executable - s.require_path = 'lib' - end - -- open File.join(util_inst_bindir, 'executable'), 'w' do |io| -+ File.open File.join(util_inst_bindir, 'executable'), 'w' do |io| - io.write <<-EXEC - #!/usr/local/bin/ruby - # -@@ -437,6 +437,8 @@ def test_generate_bin_script_no_perms - - if win_platform? - skip('test_generate_bin_script_no_perms skipped on MS Windows') -+ elsif Process.uid.zero? -+ skip('test_generate_bin_script_no_perms skipped in root privilege') - else - FileUtils.chmod 0000, util_inst_bindir - -@@ -529,6 +531,8 @@ def test_generate_bin_symlink_no_perms - - if win_platform? - skip('test_generate_bin_symlink_no_perms skipped on MS Windows') -+ elsif Process.uid.zero? -+ skip('test_user_install_disabled_read_only test skipped in root privilege') - else - FileUtils.chmod 0000, util_inst_bindir - -diff --git test/rubygems/test_gem_package.rb test/rubygems/test_gem_package.rb -index cec1981c4c..d1664cf285 100644 ---- test/rubygems/test_gem_package.rb -+++ test/rubygems/test_gem_package.rb -@@ -24,7 +24,7 @@ def setup - end - - def test_class_new_old_format -- open 'old_format.gem', 'wb' do |io| -+ File.open 'old_format.gem', 'wb' do |io| - io.write SIMPLE_GEM - end - -@@ -45,7 +45,7 @@ def test_add_checksums - - FileUtils.mkdir 'lib' - -- open 'lib/code.rb', 'w' do |io| -+ File.open 'lib/code.rb', 'w' do |io| - io.write '# lib/code.rb' - end - -@@ -110,8 +110,8 @@ def test_add_files - - FileUtils.mkdir_p 'lib/empty' - -- open 'lib/code.rb', 'w' do |io| io.write '# lib/code.rb' end -- open 'lib/extra.rb', 'w' do |io| io.write '# lib/extra.rb' end -+ File.open 'lib/code.rb', 'w' do |io| io.write '# lib/code.rb' end -+ File.open 'lib/extra.rb', 'w' do |io| io.write '# lib/extra.rb' end - - package = Gem::Package.new 'bogus.gem' - package.spec = spec -@@ -140,7 +140,7 @@ def test_add_files_symlink - spec.files = %w[lib/code.rb lib/code_sym.rb] - - FileUtils.mkdir_p 'lib' -- open 'lib/code.rb', 'w' do |io| io.write '# lib/code.rb' end -+ File.open 'lib/code.rb', 'w' do |io| io.write '# lib/code.rb' end - - # NOTE: 'code.rb' is correct, because it's relative to lib/code_sym.rb - File.symlink('code.rb', 'lib/code_sym.rb') -@@ -179,7 +179,7 @@ def test_build - - FileUtils.mkdir 'lib' - -- open 'lib/code.rb', 'w' do |io| -+ File.open 'lib/code.rb', 'w' do |io| - io.write '# lib/code.rb' - end - -@@ -218,7 +218,7 @@ def test_build_auto_signed - - FileUtils.mkdir 'lib' - -- open 'lib/code.rb', 'w' do |io| -+ File.open 'lib/code.rb', 'w' do |io| - io.write '# lib/code.rb' - end - -@@ -261,7 +261,7 @@ def test_build_auto_signed_encrypted_key - - FileUtils.mkdir 'lib' - -- open 'lib/code.rb', 'w' do |io| -+ File.open 'lib/code.rb', 'w' do |io| - io.write '# lib/code.rb' - end - -@@ -311,7 +311,7 @@ def test_build_signed - - FileUtils.mkdir 'lib' - -- open 'lib/code.rb', 'w' do |io| -+ File.open 'lib/code.rb', 'w' do |io| - io.write '# lib/code.rb' - end - -@@ -348,7 +348,7 @@ def test_build_signed_encrypted_key - - FileUtils.mkdir 'lib' - -- open 'lib/code.rb', 'w' do |io| -+ File.open 'lib/code.rb', 'w' do |io| - io.write '# lib/code.rb' - end - -@@ -408,7 +408,7 @@ def test_extract_files_empty - end - end - -- open 'empty.gem', 'wb' do |io| -+ File.open 'empty.gem', 'wb' do |io| - io.write gem.string - end - -@@ -455,6 +455,31 @@ def test_extract_tar_gz_symlink_relative_path - File.read(extracted) - end - -+ def test_extract_symlink_parent -+ skip 'symlink not supported' if Gem.win_platform? -+ -+ package = Gem::Package.new @gem -+ -+ tgz_io = util_tar_gz do |tar| -+ tar.mkdir 'lib', 0755 -+ tar.add_symlink 'lib/link', '../..', 0644 -+ tar.add_file 'lib/link/outside.txt', 0644 do |io| io.write 'hi' end -+ end -+ -+ # Extract into a subdirectory of @destination; if this test fails it writes -+ # a file outside destination_subdir, but we want the file to remain inside -+ # @destination so it will be cleaned up. -+ destination_subdir = File.join @destination, 'subdir' -+ FileUtils.mkdir_p destination_subdir -+ -+ e = assert_raises Gem::Package::PathError do -+ package.extract_tar_gz tgz_io, destination_subdir -+ end -+ -+ assert_equal("installing into parent path lib/link/outside.txt of " + -+ "#{destination_subdir} is not allowed", e.message) -+ end -+ - def test_extract_tar_gz_directory - package = Gem::Package.new @gem - -@@ -566,6 +591,21 @@ def test_install_location_relative - "#{@destination} is not allowed", e.message) - end - -+ def test_install_location_suffix -+ package = Gem::Package.new @gem -+ -+ filename = "../#{File.basename(@destination)}suffix.rb" -+ -+ e = assert_raises Gem::Package::PathError do -+ package.install_location filename, @destination -+ end -+ -+ parent = File.expand_path File.join @destination, filename -+ -+ assert_equal("installing into parent path #{parent} of " + -+ "#{@destination} is not allowed", e.message) -+ end -+ - def test_load_spec - entry = StringIO.new Gem.gzip @spec.to_yaml - def entry.full_name() 'metadata.gz' end -@@ -620,7 +660,7 @@ def test_verify_checksum_bad - end - end - -- open 'mismatch.gem', 'wb' do |io| -+ File.open 'mismatch.gem', 'wb' do |io| - io.write gem.string - end - -@@ -670,7 +710,7 @@ def test_verify_checksum_missing - end - end - -- open 'data_checksum_missing.gem', 'wb' do |io| -+ File.open 'data_checksum_missing.gem', 'wb' do |io| - io.write gem.string - end - -@@ -723,6 +763,32 @@ def test_verify_nonexistent - assert_match %r%nonexistent.gem$%, e.message - end - -+ def test_verify_duplicate_file -+ FileUtils.mkdir_p 'lib' -+ FileUtils.touch 'lib/code.rb' -+ -+ build = Gem::Package.new @gem -+ build.spec = @spec -+ build.setup_signer -+ open @gem, 'wb' do |gem_io| -+ Gem::Package::TarWriter.new gem_io do |gem| -+ build.add_metadata gem -+ build.add_contents gem -+ -+ gem.add_file_simple 'a.sig', 0444, 0 -+ gem.add_file_simple 'a.sig', 0444, 0 -+ end -+ end -+ -+ package = Gem::Package.new @gem -+ -+ e = assert_raises Gem::Security::Exception do -+ package.verify -+ end -+ -+ assert_equal 'duplicate files in the package: ("a.sig")', e.message -+ end -+ - def test_verify_security_policy - skip 'openssl is missing' unless defined?(OpenSSL::SSL) - -@@ -773,14 +839,20 @@ def test_verify_security_policy_checksum_missing - FileUtils.mkdir 'lib' - FileUtils.touch 'lib/code.rb' - -- open @gem, 'wb' do |gem_io| -+ File.open @gem, 'wb' do |gem_io| - Gem::Package::TarWriter.new gem_io do |gem| - build.add_metadata gem - build.add_contents gem - - # write bogus data.tar.gz to foil signature - bogus_data = Gem.gzip 'hello' -- gem.add_file_simple 'data.tar.gz', 0444, bogus_data.length do |io| -+ fake_signer = Class.new do -+ def digest_name; 'SHA512'; end -+ def digest_algorithm; Digest(:SHA512); end -+ def key; 'key'; end -+ def sign(*); 'fake_sig'; end -+ end -+ gem.add_file_signed 'data2.tar.gz', 0444, fake_signer.new do |io| - io.write bogus_data - end - -@@ -804,7 +876,7 @@ def test_verify_security_policy_checksum_missing - end - - def test_verify_truncate -- open 'bad.gem', 'wb' do |io| -+ File.open 'bad.gem', 'wb' do |io| - io.write File.read(@gem, 1024) # don't care about newlines - end - -diff --git test/rubygems/test_gem_package_old.rb test/rubygems/test_gem_package_old.rb -index c15475b0c7..604981b3c1 100644 ---- test/rubygems/test_gem_package_old.rb -+++ test/rubygems/test_gem_package_old.rb -@@ -7,7 +7,7 @@ class TestGemPackageOld < Gem::TestCase - def setup - super - -- open 'old_format.gem', 'wb' do |io| -+ File.open 'old_format.gem', 'wb' do |io| - io.write SIMPLE_GEM - end - -diff --git test/rubygems/test_gem_package_tar_header.rb test/rubygems/test_gem_package_tar_header.rb -index d33877057d..43f508df45 100644 ---- test/rubygems/test_gem_package_tar_header.rb -+++ test/rubygems/test_gem_package_tar_header.rb -@@ -143,5 +143,26 @@ def test_update_checksum - assert_equal '012467', @tar_header.checksum - end - -+ def test_from_bad_octal -+ test_cases = [ -+ "00000006,44\000", # bogus character -+ "00000006789\000", # non-octal digit -+ "+0000001234\000", # positive sign -+ "-0000001000\000", # negative sign -+ "0x000123abc\000", # radix prefix -+ ] -+ -+ test_cases.each do |val| -+ header_s = @tar_header.to_s -+ # overwrite the size field -+ header_s[124, 12] = val -+ io = TempIO.new header_s -+ assert_raises ArgumentError do -+ new_header = Gem::Package::TarHeader.from io -+ end -+ io.close! if io.respond_to? :close! -+ end -+ end -+ - end - -diff --git test/rubygems/test_gem_rdoc.rb test/rubygems/test_gem_rdoc.rb -index 76ca8c45a9..0355883cb3 100644 ---- test/rubygems/test_gem_rdoc.rb -+++ test/rubygems/test_gem_rdoc.rb -@@ -223,6 +223,7 @@ def test_remove - - def test_remove_unwritable - skip 'chmod not supported' if Gem.win_platform? -+ skip 'skipped in root privilege' if Process.uid.zero? - FileUtils.mkdir_p @a.base_dir - FileUtils.chmod 0, @a.base_dir - -@@ -251,6 +252,7 @@ def test_setup - - def test_setup_unwritable - skip 'chmod not supported' if Gem.win_platform? -+ skip 'skipped in root privilege' if Process.uid.zero? - FileUtils.mkdir_p @a.doc_dir - FileUtils.chmod 0, @a.doc_dir - -diff --git test/rubygems/test_gem_remote_fetcher.rb test/rubygems/test_gem_remote_fetcher.rb -index ee5ac77717..20e34e84e1 100644 ---- test/rubygems/test_gem_remote_fetcher.rb -+++ test/rubygems/test_gem_remote_fetcher.rb -@@ -431,7 +431,7 @@ def test_download_install_dir - assert File.exist?(a1_cache_gem) - end - -- unless win_platform? # File.chmod doesn't work -+ unless win_platform? || Process.uid.zero? # File.chmod doesn't work - def test_download_local_read_only - FileUtils.mv @a1_gem, @tempdir - local_path = File.join @tempdir, @a1.file_name -diff --git test/rubygems/test_gem_request_set.rb test/rubygems/test_gem_request_set.rb -index 3a48827481..5dc6c1518d 100644 ---- test/rubygems/test_gem_request_set.rb -+++ test/rubygems/test_gem_request_set.rb -@@ -52,7 +52,7 @@ def test_install_from_gemdeps - rs = Gem::RequestSet.new - installed = [] - -- open 'gem.deps.rb', 'w' do |io| -+ File.open 'gem.deps.rb', 'w' do |io| - io.puts 'gem "a"' - io.flush - -@@ -78,7 +78,7 @@ def test_install_from_gemdeps_explain - - rs = Gem::RequestSet.new - -- open 'gem.deps.rb', 'w' do |io| -+ File.open 'gem.deps.rb', 'w' do |io| - io.puts 'gem "a"' - io.flush - -@@ -104,7 +104,7 @@ def test_install_from_gemdeps_install_dir - rs = Gem::RequestSet.new - installed = [] - -- open 'gem.deps.rb', 'w' do |io| -+ File.open 'gem.deps.rb', 'w' do |io| - io.puts 'gem "a"' - end - -@@ -128,7 +128,7 @@ def test_install_from_gemdeps_local - - rs = Gem::RequestSet.new - -- open 'gem.deps.rb', 'w' do |io| -+ File.open 'gem.deps.rb', 'w' do |io| - io.puts 'gem "a"' - io.flush - -@@ -150,7 +150,7 @@ def test_install_from_gemdeps_lockfile - rs = Gem::RequestSet.new - installed = [] - -- open 'gem.deps.rb.lock', 'w' do |io| -+ File.open 'gem.deps.rb.lock', 'w' do |io| - io.puts <<-LOCKFILE - GEM - remote: #{@gem_repo} -@@ -167,7 +167,7 @@ def test_install_from_gemdeps_lockfile - LOCKFILE - end - -- open 'gem.deps.rb', 'w' do |io| -+ File.open 'gem.deps.rb', 'w' do |io| - io.puts 'gem "b"' - end - -@@ -190,7 +190,7 @@ def test_install_from_gemdeps_version_mismatch - rs = Gem::RequestSet.new - installed = [] - -- open 'gem.deps.rb', 'w' do |io| -+ File.open 'gem.deps.rb', 'w' do |io| - io.puts <<-GEM_DEPS - gem "a" - ruby "0" -diff --git test/rubygems/test_gem_request_set_lockfile.rb test/rubygems/test_gem_request_set_lockfile.rb -index 908f97303e..7460b7efad 100644 ---- test/rubygems/test_gem_request_set_lockfile.rb -+++ test/rubygems/test_gem_request_set_lockfile.rb -@@ -31,7 +31,7 @@ def lockfile - def write_lockfile lockfile - @lock_file = File.expand_path "#{@gem_deps_file}.lock" - -- open @lock_file, 'w' do |io| -+ File.open @lock_file, 'w' do |io| - io.write lockfile - end - end -@@ -387,7 +387,7 @@ def test_to_s_git - s.add_dependency 'c', '~> 1.0' - end - -- open 'b.gemspec', 'w' do |io| -+ File.open 'b.gemspec', 'w' do |io| - io.write b.to_ruby - end - -@@ -400,7 +400,7 @@ def test_to_s_git - Dir.chdir 'c' do - c = Gem::Specification.new 'c', 1 - -- open 'c.gemspec', 'w' do |io| -+ File.open 'c.gemspec', 'w' do |io| - io.write c.to_ruby - end - -@@ -455,7 +455,7 @@ def test_write_error - - gem_deps_lock_file = "#{@gem_deps_file}.lock" - -- open gem_deps_lock_file, 'w' do |io| -+ File.open gem_deps_lock_file, 'w' do |io| - io.write 'hello' - end - -diff --git test/rubygems/test_gem_request_set_lockfile_parser.rb test/rubygems/test_gem_request_set_lockfile_parser.rb -index 9946c522d9..f3517da43a 100644 ---- test/rubygems/test_gem_request_set_lockfile_parser.rb -+++ test/rubygems/test_gem_request_set_lockfile_parser.rb -@@ -536,7 +536,7 @@ def test_parse_missing - end - - def write_lockfile lockfile -- open @lock_file, 'w' do |io| -+ File.open @lock_file, 'w' do |io| - io.write lockfile - end - end -diff --git test/rubygems/test_gem_request_set_lockfile_tokenizer.rb test/rubygems/test_gem_request_set_lockfile_tokenizer.rb -index ab506a14e6..f4aba6d94a 100644 ---- test/rubygems/test_gem_request_set_lockfile_tokenizer.rb -+++ test/rubygems/test_gem_request_set_lockfile_tokenizer.rb -@@ -295,7 +295,7 @@ def test_unget - end - - def write_lockfile lockfile -- open @lock_file, 'w' do |io| -+ File.open @lock_file, 'w' do |io| - io.write lockfile - end - end -diff --git test/rubygems/test_gem_resolver_git_specification.rb test/rubygems/test_gem_resolver_git_specification.rb -index 9e8e2c5715..211757eb20 100644 ---- test/rubygems/test_gem_resolver_git_specification.rb -+++ test/rubygems/test_gem_resolver_git_specification.rb -@@ -70,7 +70,7 @@ def test_install_extension - Dir.chdir 'git/a' do - FileUtils.mkdir_p 'ext/lib' - -- open 'ext/extconf.rb', 'w' do |io| -+ File.open 'ext/extconf.rb', 'w' do |io| - io.puts 'require "mkmf"' - io.puts 'create_makefile "a"' - end -diff --git test/rubygems/test_gem_server.rb test/rubygems/test_gem_server.rb -index 6fe02e480f..a018e65512 100644 ---- test/rubygems/test_gem_server.rb -+++ test/rubygems/test_gem_server.rb -@@ -100,7 +100,7 @@ def test_latest_specs_gemdirs - specs_dir = File.join dir, 'specifications' - FileUtils.mkdir_p specs_dir - -- open File.join(specs_dir, spec.spec_name), 'w' do |io| -+ File.open File.join(specs_dir, spec.spec_name), 'w' do |io| - io.write spec.to_ruby - end - -@@ -198,7 +198,7 @@ def test_quick_gemdirs - - FileUtils.mkdir_p specs_dir - -- open File.join(specs_dir, spec.spec_name), 'w' do |io| -+ File.open File.join(specs_dir, spec.spec_name), 'w' do |io| - io.write spec.to_ruby - end - -@@ -339,7 +339,7 @@ def test_root_gemdirs - specs_dir = File.join dir, 'specifications' - FileUtils.mkdir_p specs_dir - -- open File.join(specs_dir, spec.spec_name), 'w' do |io| -+ File.open File.join(specs_dir, spec.spec_name), 'w' do |io| - io.write spec.to_ruby - end - -@@ -353,6 +353,171 @@ def test_root_gemdirs - assert_match 'z 9', @res.body - end - -+ -+ def test_xss_homepage_fix_289313 -+ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" -+ dir = "#{@gemhome}2" -+ -+ spec = util_spec 'xsshomepagegem', 1 -+ spec.homepage = "javascript:confirm(document.domain)" -+ -+ specs_dir = File.join dir, 'specifications' -+ FileUtils.mkdir_p specs_dir -+ -+ open File.join(specs_dir, spec.spec_name), 'w' do |io| -+ io.write spec.to_ruby -+ end -+ -+ server = Gem::Server.new dir, process_based_port, false -+ -+ @req.parse data -+ -+ server.root @req, @res -+ -+ assert_equal 200, @res.status -+ assert_match 'xsshomepagegem 1', @res.body -+ -+ # This verifies that the homepage for this spec is not displayed and is set to ".", because it's not a -+ # valid HTTP/HTTPS URL and could be unsafe in an HTML context. We would prefer to throw an exception here, -+ # but spec.homepage is currently free form and not currently required to be a URL, this behavior may be -+ # validated in future versions of Gem::Specification. -+ # -+ # There are two variant we're checking here, one where rdoc is not present, and one where rdoc is present in the same regex: -+ # -+ # Variant #1 - rdoc not installed -+ # -+ # xsshomepagegem 1 -+ # -+ # -+ # [rdoc] -+ # -+ # -+ # -+ # [www] -+ # -+ # Variant #2 - rdoc installed -+ # -+ # xsshomepagegem 1 -+ # -+ # -+ # \[rdoc\]<\/a> -+ # -+ # -+ # -+ # [www] -+ regex_match = /xsshomepagegem 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ -+ assert_match regex_match, @res.body -+ end -+ -+ def test_invalid_homepage -+ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" -+ dir = "#{@gemhome}2" -+ -+ spec = util_spec 'invalidhomepagegem', 1 -+ spec.homepage = "notavalidhomepageurl" -+ -+ specs_dir = File.join dir, 'specifications' -+ FileUtils.mkdir_p specs_dir -+ -+ open File.join(specs_dir, spec.spec_name), 'w' do |io| -+ io.write spec.to_ruby -+ end -+ -+ server = Gem::Server.new dir, process_based_port, false -+ -+ @req.parse data -+ -+ server.root @req, @res -+ -+ assert_equal 200, @res.status -+ assert_match 'invalidhomepagegem 1', @res.body -+ -+ # This verifies that the homepage for this spec is not displayed and is set to ".", because it's not a -+ # valid HTTP/HTTPS URL and could be unsafe in an HTML context. We would prefer to throw an exception here, -+ # but spec.homepage is currently free form and not currently required to be a URL, this behavior may be -+ # validated in future versions of Gem::Specification. -+ # -+ # There are two variant we're checking here, one where rdoc is not present, and one where rdoc is present in the same regex: -+ # -+ # Variant #1 - rdoc not installed -+ # -+ # invalidhomepagegem 1 -+ # -+ # -+ # [rdoc] -+ # -+ # -+ # -+ # [www] -+ # -+ # Variant #2 - rdoc installed -+ # -+ # invalidhomepagegem 1 -+ # -+ # -+ # \[rdoc\]<\/a> -+ # -+ # -+ # -+ # [www] -+ regex_match = /invalidhomepagegem 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ -+ assert_match regex_match, @res.body -+ end -+ -+ def test_valid_homepage_http -+ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" -+ dir = "#{@gemhome}2" -+ -+ spec = util_spec 'validhomepagegemhttp', 1 -+ spec.homepage = "http://rubygems.org" -+ -+ specs_dir = File.join dir, 'specifications' -+ FileUtils.mkdir_p specs_dir -+ -+ open File.join(specs_dir, spec.spec_name), 'w' do |io| -+ io.write spec.to_ruby -+ end -+ -+ server = Gem::Server.new dir, process_based_port, false -+ -+ @req.parse data -+ -+ server.root @req, @res -+ -+ assert_equal 200, @res.status -+ assert_match 'validhomepagegemhttp 1', @res.body -+ -+ regex_match = /validhomepagegemhttp 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ -+ assert_match regex_match, @res.body -+ end -+ -+ def test_valid_homepage_https -+ data = StringIO.new "GET / HTTP/1.0\r\n\r\n" -+ dir = "#{@gemhome}2" -+ -+ spec = util_spec 'validhomepagegemhttps', 1 -+ spec.homepage = "https://rubygems.org" -+ -+ specs_dir = File.join dir, 'specifications' -+ FileUtils.mkdir_p specs_dir -+ -+ open File.join(specs_dir, spec.spec_name), 'w' do |io| -+ io.write spec.to_ruby -+ end -+ -+ server = Gem::Server.new dir, process_based_port, false -+ -+ @req.parse data -+ -+ server.root @req, @res -+ -+ assert_equal 200, @res.status -+ assert_match 'validhomepagegemhttps 1', @res.body -+ -+ regex_match = /validhomepagegemhttps 1<\/b>[\n\s]+(\[rdoc\]<\/span>|\[rdoc\]<\/a>)[\n\s]+\[www\]<\/a>/ -+ assert_match regex_match, @res.body -+ end -+ - def test_specs - data = StringIO.new "GET /specs.#{Gem.marshal_version} HTTP/1.0\r\n\r\n" - @req.parse data -@@ -378,7 +543,7 @@ def test_specs_gemdirs - specs_dir = File.join dir, 'specifications' - FileUtils.mkdir_p specs_dir - -- open File.join(specs_dir, spec.spec_name), 'w' do |io| -+ File.open File.join(specs_dir, spec.spec_name), 'w' do |io| - io.write spec.to_ruby - end - -diff --git test/rubygems/test_gem_source.rb test/rubygems/test_gem_source.rb -index 4a93e222f8..8805a9b404 100644 ---- test/rubygems/test_gem_source.rb -+++ test/rubygems/test_gem_source.rb -@@ -110,7 +110,7 @@ def test_fetch_spec_cached - - cache_file = File.join cache_dir, a1.spec_name - -- open cache_file, 'wb' do |io| -+ File.open cache_file, 'wb' do |io| - Marshal.dump a1, io - end - -@@ -163,7 +163,7 @@ def test_load_specs_cached - - cache_file = File.join cache_dir, "latest_specs.#{Gem.marshal_version}" - -- open cache_file, 'wb' do |io| -+ File.open cache_file, 'wb' do |io| - Marshal.dump latest_specs, io - end - -@@ -187,7 +187,7 @@ def test_load_specs_cached_empty - - cache_file = File.join cache_dir, "latest_specs.#{Gem.marshal_version}" - -- open cache_file, 'wb' do |io| -+ File.open cache_file, 'wb' do |io| - # Setup invalid data in the cache: - io.write Marshal.dump(latest_specs)[0, 10] - end -diff --git test/rubygems/test_gem_source_git.rb test/rubygems/test_gem_source_git.rb -index 0e13a11e7e..8f5d3ee745 100644 ---- test/rubygems/test_gem_source_git.rb -+++ test/rubygems/test_gem_source_git.rb -@@ -229,7 +229,7 @@ def test_specs - Dir.chdir 'b' do - b = Gem::Specification.new 'b', 1 - -- open 'b.gemspec', 'w' do |io| -+ File.open 'b.gemspec', 'w' do |io| - io.write b.to_ruby - end - -diff --git test/rubygems/test_gem_specification.rb test/rubygems/test_gem_specification.rb -index bb6acbc7de..badb297eee 100644 ---- test/rubygems/test_gem_specification.rb -+++ test/rubygems/test_gem_specification.rb -@@ -922,7 +922,7 @@ def test_self_load - end - - def test_self_load_relative -- open 'a-2.gemspec', 'w' do |io| -+ File.open 'a-2.gemspec', 'w' do |io| - io.write @a2.to_ruby_for_cache - end - -@@ -948,6 +948,9 @@ def test_self_load_tainted - @a2.files.clear - - assert_equal @a2, spec -+ -+ ensure -+ $SAFE = 0 - end - - def test_self_load_escape_curly -@@ -1111,7 +1114,7 @@ def test_self_remove_spec - end - - def test_self_remove_spec_removed -- open @a1.spec_file, 'w' do |io| -+ File.open @a1.spec_file, 'w' do |io| - io.write @a1.to_ruby - end - -@@ -1363,13 +1366,13 @@ def test_build_args - - assert_empty @ext.build_args - -- open @ext.build_info_file, 'w' do |io| -+ File.open @ext.build_info_file, 'w' do |io| - io.puts - end - - assert_empty @ext.build_args - -- open @ext.build_info_file, 'w' do |io| -+ File.open @ext.build_info_file, 'w' do |io| - io.puts '--with-foo-dir=wherever' - end - -@@ -1385,9 +1388,9 @@ def test_build_extensions - extconf_rb = File.join @ext.gem_dir, @ext.extensions.first - FileUtils.mkdir_p File.dirname extconf_rb - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' -- open 'Makefile', 'w' do |f| -+ File.open 'Makefile', 'w' do |f| - f.puts "clean:\n\techo clean" - f.puts "default:\n\techo built" - f.puts "install:\n\techo installed" -@@ -1435,9 +1438,9 @@ def test_build_extensions_default_gem - extconf_rb = File.join spec.gem_dir, spec.extensions.first - FileUtils.mkdir_p File.dirname extconf_rb - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' -- open 'Makefile', 'w' do |f| -+ File.open 'Makefile', 'w' do |f| - f.puts "default:\n\techo built" - f.puts "install:\n\techo installed" - end -@@ -1461,6 +1464,7 @@ def test_build_extensions_error - - def test_build_extensions_extensions_dir_unwritable - skip 'chmod not supported' if Gem.win_platform? -+ skip 'skipped in root privilege' if Process.uid.zero? - - ext_spec - -@@ -1469,9 +1473,9 @@ def test_build_extensions_extensions_dir_unwritable - extconf_rb = File.join @ext.gem_dir, @ext.extensions.first - FileUtils.mkdir_p File.dirname extconf_rb - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' -- open 'Makefile', 'w' do |f| -+ File.open 'Makefile', 'w' do |f| - f.puts "clean:\n\techo clean" - f.puts "default:\n\techo built" - f.puts "install:\n\techo installed" -@@ -1486,7 +1490,7 @@ def test_build_extensions_extensions_dir_unwritable - @ext.build_extensions - refute_path_exists @ext.extension_dir - ensure -- unless ($DEBUG or win_platform?) then -+ unless ($DEBUG or win_platform? or Process.uid.zero?) then - FileUtils.chmod 0755, File.join(@ext.base_dir, 'extensions') - FileUtils.chmod 0755, @ext.base_dir - end -@@ -1502,9 +1506,9 @@ def test_build_extensions_no_extensions_dir_unwritable - extconf_rb = File.join @ext.gem_dir, @ext.extensions.first - FileUtils.mkdir_p File.dirname extconf_rb - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' -- open 'Makefile', 'w' do |f| -+ File.open 'Makefile', 'w' do |f| - f.puts "clean:\n\techo clean" - f.puts "default:\n\techo built" - f.puts "install:\n\techo installed" -@@ -1551,9 +1555,9 @@ def test_build_extensions_preview - extconf_rb = File.join @ext.gem_dir, @ext.extensions.first - FileUtils.mkdir_p File.dirname extconf_rb - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' -- open 'Makefile', 'w' do |f| -+ File.open 'Makefile', 'w' do |f| - f.puts "clean:\n\techo clean" - f.puts "default:\n\techo built" - f.puts "install:\n\techo installed" -@@ -2882,7 +2886,22 @@ def test_validate_homepage - @a1.validate - end - -- assert_equal '"over at my cool site" is not a URI', e.message -+ assert_equal '"over at my cool site" is not a valid HTTP URI', e.message -+ -+ @a1.homepage = 'ftp://rubygems.org' -+ -+ e = assert_raises Gem::InvalidSpecificationException do -+ @a1.validate -+ end -+ -+ assert_equal '"ftp://rubygems.org" is not a valid HTTP URI', e.message -+ -+ @a1.homepage = 'http://rubygems.org' -+ assert_equal true, @a1.validate -+ -+ @a1.homepage = 'https://rubygems.org' -+ assert_equal true, @a1.validate -+ - end - end - -@@ -3418,9 +3437,9 @@ def test_missing_extensions_eh - extconf_rb = File.join @ext.gem_dir, @ext.extensions.first - FileUtils.mkdir_p File.dirname extconf_rb - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' -- open 'Makefile', 'w' do |f| -+ File.open 'Makefile', 'w' do |f| - f.puts "clean:\n\techo clean" - f.puts "default:\n\techo built" - f.puts "install:\n\techo installed" -diff --git test/rubygems/test_gem_stub_specification.rb test/rubygems/test_gem_stub_specification.rb -index 43680265c7..f9a3a236c0 100644 ---- test/rubygems/test_gem_stub_specification.rb -+++ test/rubygems/test_gem_stub_specification.rb -@@ -127,9 +127,9 @@ def test_missing_extensions_eh - extconf_rb = File.join s.gem_dir, s.extensions.first - FileUtils.mkdir_p File.dirname extconf_rb - -- open extconf_rb, 'w' do |f| -+ File.open extconf_rb, 'w' do |f| - f.write <<-'RUBY' -- open 'Makefile', 'w' do |f| -+ File.open 'Makefile', 'w' do |f| - f.puts "clean:\n\techo clean" - f.puts "default:\n\techo built" - f.puts "install:\n\techo installed" -@@ -149,7 +149,7 @@ def test_missing_extensions_eh_default_gem - spec = new_default_spec 'default', 1 - spec.extensions << 'extconf.rb' - -- open spec.loaded_from, 'w' do |io| -+ File.open spec.loaded_from, 'w' do |io| - io.write spec.to_ruby_for_cache - end - -@@ -198,7 +198,7 @@ def test_to_spec_missing_extensions - - def stub_with_version - spec = File.join @gemhome, 'specifications', 'stub_e-2.gemspec' -- open spec, 'w' do |io| -+ File.open spec, 'w' do |io| - io.write <<-STUB - # -*- encoding: utf-8 -*- - # stub: stub_v 2 ruby lib -@@ -221,7 +221,7 @@ def stub_with_version - - def stub_without_version - spec = File.join @gemhome, 'specifications', 'stub-2.gemspec' -- open spec, 'w' do |io| -+ File.open spec, 'w' do |io| - io.write <<-STUB - # -*- encoding: utf-8 -*- - # stub: stub_v ruby lib -@@ -245,7 +245,7 @@ def stub_without_version - - def stub_with_extension - spec = File.join @gemhome, 'specifications', 'stub_e-2.gemspec' -- open spec, 'w' do |io| -+ File.open spec, 'w' do |io| - io.write <<-STUB - # -*- encoding: utf-8 -*- - # stub: stub_e 2 ruby lib -@@ -271,7 +271,7 @@ def stub_with_extension - - def stub_without_extension - spec = File.join @gemhome, 'specifications', 'stub-2.gemspec' -- open spec, 'w' do |io| -+ File.open spec, 'w' do |io| - io.write <<-STUB - # -*- encoding: utf-8 -*- - # stub: stub 2 ruby lib -diff --git test/rubygems/test_gem_util.rb test/rubygems/test_gem_util.rb -index b85db44d51..3b7887d931 100644 ---- test/rubygems/test_gem_util.rb -+++ test/rubygems/test_gem_util.rb -@@ -5,6 +5,7 @@ - class TestGemUtil < Gem::TestCase - - def test_class_popen -+ skip "MJIT executes process and it's caught by Process.wait(-1)" if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? - assert_equal "0\n", Gem::Util.popen(Gem.ruby, '-e', 'p 0') - - assert_raises Errno::ECHILD do -@@ -29,6 +30,30 @@ def test_traverse_parents - loop { break if enum.next.nil? } # exhaust the enumerator - end - -+ def test_traverse_parents_does_not_crash_on_permissions_error -+ skip 'skipped on MS Windows (chmod has no effect)' if win_platform? -+ -+ FileUtils.mkdir_p 'd/e/f' -+ # remove 'execute' permission from "e" directory and make it -+ # impossible to cd into it and its children -+ FileUtils.chmod(0666, 'd/e') -+ -+ paths = Gem::Util.traverse_parents('d/e/f').to_a -+ -+ assert_equal File.join(@tempdir, 'd'), paths[0] -+ assert_equal @tempdir, paths[1] -+ if File.respond_to?(:realpath) -+ assert_equal File.realpath(Dir.tmpdir), paths[2] -+ assert_equal File.realpath("..", Dir.tmpdir), paths[3] -+ elsif RUBY_PLATFORM !~ /darwin/ -+ assert_equal Dir.tmpdir, paths[2] -+ assert_equal '/', paths[3] -+ end -+ ensure -+ # restore default permissions, allow the directory to be removed -+ FileUtils.chmod(0775, 'd/e') unless win_platform? -+ end -+ - def test_linked_list_find - list = [1,2,3,4,5].inject(Gem::List.new(0)) { |m,o| - Gem::List.new o, m -diff --git test/rubygems/test_gem_version.rb test/rubygems/test_gem_version.rb -index 56c818663e..792ad5f084 100644 ---- test/rubygems/test_gem_version.rb -+++ test/rubygems/test_gem_version.rb -@@ -2,6 +2,8 @@ - require 'rubygems/test_case' - require "rubygems/version" - -+require "minitest/benchmark" -+ - class TestGemVersion < Gem::TestCase - - class V < ::Gem::Version -@@ -102,6 +104,15 @@ def test_initialize_invalid - end - end - -+ def bench_anchored_version_pattern -+ assert_performance_linear 0.5 do |count| -+ version_string = count.times.map {|i| "0" * i.succ }.join(".") << "." -+ version_string =~ Gem::Version::ANCHORED_VERSION_PATTERN -+ end -+ rescue RegexpError -+ skip "It fails to allocate the memory for regex pattern of Gem::Version::ANCHORED_VERSION_PATTERN" -+ end -+ - def test_empty_version - ["", " ", " "].each do |empty| - assert_equal "0", Gem::Version.new(empty).version -diff --git test/rubygems/test_require.rb test/rubygems/test_require.rb -index a846f46833..e292ce226d 100644 ---- test/rubygems/test_require.rb -+++ test/rubygems/test_require.rb -@@ -38,18 +38,6 @@ def assert_require(path) - assert require(path), "'#{path}' was already required" - end - -- def append_latch spec -- dir = spec.gem_dir -- Dir.chdir dir do -- spec.files.each do |file| -- File.open file, 'a' do |fp| -- fp.puts "FILE_ENTERED_LATCH.release" -- fp.puts "FILE_EXIT_LATCH.await" -- end -- end -- end -- end -- - # Providing -I on the commandline should always beat gems - def test_dash_i_beats_gems - a1 = new_spec "a", "1", {"b" => "= 1"}, "lib/test_gem_require_a.rb" -@@ -80,6 +68,17 @@ def test_dash_i_beats_gems - Object.send :remove_const, :HELLO if Object.const_defined? :HELLO - end - -+ def create_sync_thread -+ Thread.new do -+ begin -+ yield -+ ensure -+ FILE_ENTERED_LATCH.release -+ FILE_EXIT_LATCH.await -+ end -+ end -+ end -+ - def test_concurrent_require - skip 'deadlock' if /^1\.8\./ =~ RUBY_VERSION - -@@ -91,11 +90,8 @@ def test_concurrent_require - - install_specs a1, b1 - -- append_latch a1 -- append_latch b1 -- -- t1 = Thread.new { assert_require 'a' } -- t2 = Thread.new { assert_require 'b' } -+ t1 = create_sync_thread{ assert_require 'a' } -+ t2 = create_sync_thread{ assert_require 'b' } - - # wait until both files are waiting on the exit latch - FILE_ENTERED_LATCH.await -@@ -106,10 +102,8 @@ def test_concurrent_require - assert t1.join, "thread 1 should exit" - assert t2.join, "thread 2 should exit" - ensure -- return if $! # skipping -- -- Object.send :remove_const, :FILE_ENTERED_LATCH -- Object.send :remove_const, :FILE_EXIT_LATCH -+ Object.send :remove_const, :FILE_ENTERED_LATCH if Object.const_defined? :FILE_ENTERED_LATCH -+ Object.send :remove_const, :FILE_EXIT_LATCH if Object.const_defined? :FILE_EXIT_LATCH - end - - def test_require_is_not_lazy_with_exact_req diff --git a/sources b/sources index a289e4c..7ef486c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ruby-2.5.0.tar.xz) = 55714a33d7661fe8b432f73c34fd67b49699f8b79df1cbd680a74899124d31111ab0f444677672aac1ba725820182940d485efb2db0bf2bc96737c5d40c54578 +SHA512 (ruby-2.5.1.tar.xz) = 31bacf58469953282cd5d8b51862dcf4b84dedb927c1871bc3fca32fc157fe49187631575a70838705fe246f4555647577a7ecc26894445a7d64de5503dc11b4 From 1085ba2aed03b62ca051d7d23627fede1fd5a7f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 10 Apr 2018 09:07:02 +0200 Subject: [PATCH 08/21] Conflict requirement needs to generate dependency. If there is only conflict requirement, this still menas that there is dependency on that package and appropriate requirement must be generated (rhbz#1561487) --- ruby.spec | 3 +++ rubygems.req | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ruby.spec b/ruby.spec index 757cc97..955810a 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1067,6 +1067,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Tue Apr 10 2018 Vít Ondruch - 2.5.1-92 +- Conflict requirement needs to generate dependency. + * Thu Mar 29 2018 Pavel Valena - 2.5.1-92 - Update to Ruby 2.5.1. diff --git a/rubygems.req b/rubygems.req index 6868bdd..d75247d 100644 --- a/rubygems.req +++ b/rubygems.req @@ -11,7 +11,13 @@ module RubyGemsReq when '~>' expand_pessimistic_requirement(r) when '!=' - [] + # If there is only the conflict requirement, we still need to depend + # on the specified gem. + if requirements.size == 1 + Gem::Requirement.default.requirements + else + [] + end else [r] end From 51449f1f93ec716ae6b3b63fc0d74dd3dbbda060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 10 Apr 2018 09:09:46 +0200 Subject: [PATCH 09/21] Revert "Use --with-setjmp-type=setjmp on aarch64 to work around gcc issue (#1545239)" This reverts commit a3207ebb169bacb722745448c114f015d63cd25c. This should not be needed, since changes in GCC were reverted. --- ruby.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ruby.spec b/ruby.spec index 955810a..57e522c 100644 --- a/ruby.spec +++ b/ruby.spec @@ -554,9 +554,6 @@ autoconf --with-ruby-version='' \ --enable-multiarch \ --with-prelude=./abrt_prelude.rb \ -%ifarch aarch64 - --with-setjmp-type=setjmp \ -%endif # Q= makes the build output more verbose and allows to check Fedora # compiler options. @@ -1069,6 +1066,7 @@ make check TESTS="-v $DISABLE_TESTS" %changelog * Tue Apr 10 2018 Vít Ondruch - 2.5.1-92 - Conflict requirement needs to generate dependency. +- Stop using --with-setjmp-type=setjmp on aarch64 (rhbz#1545239). * Thu Mar 29 2018 Pavel Valena - 2.5.1-92 - Update to Ruby 2.5.1. From e20662a3f69826df626116e3fbbd48f33d17e253 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Wed, 2 May 2018 17:00:36 +0200 Subject: [PATCH 10/21] Make %gemspec_{add,remove}_dep modify .gemspec provided by %setup macro. The macros need to be udpated, since RPM 4.14+ can expand .gem files and also also provide %{gem_name}.gemspec file used to rebuild the gem. However, the .gemspec file is not in current directory, but directly in %{_builddir}. --- macros.rubygems | 4 ++-- ruby.spec | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/macros.rubygems b/macros.rubygems index 0652ec6..2cb96a6 100644 --- a/macros.rubygems +++ b/macros.rubygems @@ -60,7 +60,7 @@ gem install \\\ # %gemspec_add_dep(g:s:d) \ read -d '' gemspec_add_dep_script << 'EOR' || : \ - gemspec_file = '%{-s*}%{!?-s:./%{gem_name}.gemspec}' \ + gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}.gemspec}' \ \ name = '%{-g*}' \ requirements = %{*}%{!?1:nil} \ @@ -97,7 +97,7 @@ unset -v gemspec_add_dep_script \ # %gemspec_remove_dep(g:s:d) \ read -d '' gemspec_remove_dep_script << 'EOR' || : \ - gemspec_file = '%{-s*}%{!?-s:./%{gem_name}.gemspec}' \ + gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}.gemspec}' \ \ name = '%{-g*}' \ requirements = %{*}%{!?1:nil} \ diff --git a/ruby.spec b/ruby.spec index 57e522c..9425d79 100644 --- a/ruby.spec +++ b/ruby.spec @@ -21,7 +21,7 @@ %endif -%global release 92 +%global release 93 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory three, since the @@ -1064,6 +1064,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Wed May 02 2018 Vít Ondruch - 2.5.1-93 +- Make %%gemspec_{add,remove}_dep modify .gemspec provided by %%setup macro. + * Tue Apr 10 2018 Vít Ondruch - 2.5.1-92 - Conflict requirement needs to generate dependency. - Stop using --with-setjmp-type=setjmp on aarch64 (rhbz#1545239). From 08389a5fcd63d26338afac47900c55efcc992b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Thu, 3 May 2018 15:16:00 +0200 Subject: [PATCH 11/21] Fix typos in macro description. --- macros.rubygems | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros.rubygems b/macros.rubygems index 2cb96a6..b4dfc92 100644 --- a/macros.rubygems +++ b/macros.rubygems @@ -42,8 +42,8 @@ gem install \\\ } -# The 'read' command in gemspec_add _depand gemspec_remove_dep macros is not -# essential, but it is usefull to make the sript appear in build log. +# The 'read' command in gemspec_add_dep and gemspec_remove_dep macros is not +# essential, but it is usefull to make the script appear in build log. # %gemspec_add_dep - Add dependency into .gemspec. From 4c9a5a5e9ec8f394080cde6647df763787098695 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 3 May 2018 14:53:28 +0200 Subject: [PATCH 12/21] Add macros to edit files lists in .gemspec %gemspec_add_file and %gemspec_remove_file. --- macros.rubygems | 69 +++++++++++++++++++++++++++++++++++++++++++++++-- ruby.spec | 4 +++ 2 files changed, 71 insertions(+), 2 deletions(-) diff --git a/macros.rubygems b/macros.rubygems index b4dfc92..d2e8514 100644 --- a/macros.rubygems +++ b/macros.rubygems @@ -42,8 +42,8 @@ gem install \\\ } -# The 'read' command in gemspec_add_dep and gemspec_remove_dep macros is not -# essential, but it is usefull to make the script appear in build log. +# The 'read' command in %%gemspec_* macros is not essential, but it is usefull +# to make the sript appear in build log. # %gemspec_add_dep - Add dependency into .gemspec. @@ -128,3 +128,68 @@ EOR\ echo "$gemspec_remove_dep_script" | ruby \ unset -v gemspec_remove_dep_script \ %{nil} + + +# %%gemspec_add_file - Add files to various files lists in .gemspec. +# +# Usage: %%gemspec_add_file [options] +# +# Add files to .gemspec file. is expected to be valid Ruby code. +# Path to file is expected. Does not check real files in any way. +# By default, `files` list is edited. +# +# -s Overrides the default .gemspec location. +# -t Edit test_files only. +# -r Edit extra_rdoc_files only. +# +%gemspec_add_file(s:tr) \ +read -d '' gemspec_add_file_script << 'EOR' || : \ + gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}.gemspec}' \ + \ + abort("gemspec_add_file: Use only one '-t' or '-r' at a time.") if "%{?-t}%{?-r}" == "-t-r" \ + \ + filenames = %{*}%{!?1:nil} \ + filenames = Array(filenames) \ + \ + spec = Gem::Specification.load(gemspec_file) \ + abort("#{gemspec_file} is not accessible.") unless spec \ + \ + spec.%{?-t:test_}%{?-r:extra_rdoc_}files += filenames \ + File.write gemspec_file, spec.to_ruby \ +EOR\ +echo "$gemspec_add_file_script" | ruby \ +unset -v gemspec_add_file_script \ +%{nil} + + +# %%gemspec_remove_file - Remove files from various files lists in .gemspec. +# +# Usage: %%gemspec_remove_file [options] +# +# Remove files from .gemspec file. is expected to be valid Ruby code. +# Path to file is expected. Does not check/remove real files in any way. +# By default, `files` list is edited. File has to be removed from `test_files` +# first in order to be removable from `files`. +# +# -s Overrides the default .gemspec location. +# -t Edit test_files only. +# -r Edit extra_rdoc_files only. +# +%gemspec_remove_file(s:tr) \ +read -d '' gemspec_remove_file_script << 'EOR' || : \ + gemspec_file = '%{-s*}%{!?-s:%{_builddir}/%{gem_name}-%{version}.gemspec}' \ + \ + abort("gemspec_remove_file: Use only one '-t' or '-r' at a time.") if "%{?-t}%{?-r}" == "-t-r" \ + \ + filenames = %{*}%{!?1:nil} \ + filenames = Array(filenames) \ + \ + spec = Gem::Specification.load(gemspec_file) \ + abort("#{gemspec_file} is not accessible.") unless spec \ + \ + spec.%{?-t:test_}%{?-r:extra_rdoc_}files -= filenames \ + File.write gemspec_file, spec.to_ruby \ +EOR\ +echo "$gemspec_remove_file_script" | ruby \ +unset -v gemspec_remove_file_script \ +%{nil} diff --git a/ruby.spec b/ruby.spec index 9425d79..0f8b9ad 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1064,6 +1064,10 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Thu May 10 2018 Pavel Valena - 2.5.1-93 +- Add macros to edit files lists in .gemspec + (gemspec_add_file and gemspec_remove_file). + * Wed May 02 2018 Vít Ondruch - 2.5.1-93 - Make %%gemspec_{add,remove}_dep modify .gemspec provided by %%setup macro. From 344302bd25c9eba129a8789e0c855bda50494a0e Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Fri, 19 Oct 2018 13:58:00 +0200 Subject: [PATCH 13/21] Update to Ruby 2.5.3. --- ruby-1.9.3-mkmf-verbose.patch | 2 +- ...-test-failures-Kiritimati-and-Lisbon.patch | 115 ------------------ ruby.spec | 13 +- sources | 2 +- 4 files changed, 8 insertions(+), 124 deletions(-) delete mode 100644 ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch diff --git a/ruby-1.9.3-mkmf-verbose.patch b/ruby-1.9.3-mkmf-verbose.patch index f2a1408..b523657 100644 --- a/ruby-1.9.3-mkmf-verbose.patch +++ b/ruby-1.9.3-mkmf-verbose.patch @@ -11,7 +11,7 @@ diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 682eb46..e6b1445 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb -@@ -1899,7 +1899,7 @@ def configuration(srcdir) +@@ -1900,7 +1900,7 @@ def configuration(srcdir) SHELL = /bin/sh # V=0 quiet, V=1 verbose. other values don't work. diff --git a/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch b/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch deleted file mode 100644 index fa5ad3e..0000000 --- a/ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 584b5929f9b769c4d0b03e322a9fddf2b2dd3454 Mon Sep 17 00:00:00 2001 -From: nobu -Date: Sun, 1 Apr 2018 13:02:11 +0000 -Subject: [PATCH] test_time_tz.rb: Kiritimati tzdata fix - -* test/ruby/test_time_tz.rb (gen_zdump_test): fix the expected - data at the Kiritimati's skip of New Year's Eve 1994. - [Bug #14655] - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - test/ruby/test_time_tz.rb | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb -index dfe139033ed3..ac5f81892878 100644 ---- a/test/ruby/test_time_tz.rb -+++ b/test/ruby/test_time_tz.rb -@@ -364,9 +364,18 @@ def self.gen_zdump_test(data) - Europe/London Sun Aug 10 01:00:00 1947 UTC = Sun Aug 10 02:00:00 1947 BST isdst=1 gmtoff=3600 - Europe/London Sun Nov 2 01:59:59 1947 UTC = Sun Nov 2 02:59:59 1947 BST isdst=1 gmtoff=3600 - Europe/London Sun Nov 2 02:00:00 1947 UTC = Sun Nov 2 02:00:00 1947 GMT isdst=0 gmtoff=0 -+End -+ if CORRECT_KIRITIMATI_SKIP_1994 -+ gen_zdump_test <<'End' -+Pacific/Kiritimati Sat Dec 31 09:59:59 1994 UTC = Fri Dec 30 23:59:59 1994 LINT isdst=0 gmtoff=-36000 -+Pacific/Kiritimati Sat Dec 31 10:00:00 1994 UTC = Sun Jan 1 00:00:00 1995 LINT isdst=0 gmtoff=50400 -+End -+ else -+ gen_zdump_test <<'End' - Pacific/Kiritimati Sun Jan 1 09:59:59 1995 UTC = Sat Dec 31 23:59:59 1994 LINT isdst=0 gmtoff=-36000 - Pacific/Kiritimati Sun Jan 1 10:00:00 1995 UTC = Mon Jan 2 00:00:00 1995 LINT isdst=0 gmtoff=50400 - End -+ end - gen_zdump_test <<'End' if has_right_tz - right/America/Los_Angeles Fri Jun 30 23:59:60 1972 UTC = Fri Jun 30 16:59:60 1972 PDT isdst=1 gmtoff=-25200 - right/America/Los_Angeles Wed Dec 31 23:59:60 2008 UTC = Wed Dec 31 15:59:60 2008 PST isdst=0 gmtoff=-28800 --- - -From 2965c2d4df78e6f5acf8759f84c88ce14a4e70f1 Mon Sep 17 00:00:00 2001 -From: nobu -Date: Sun, 1 Apr 2018 02:00:36 +0000 -Subject: [PATCH] test_time_tz.rb: Kiritimati tzdata fix - -* test/ruby/test_time_tz.rb (TestTimeTZ#test_pacific_kiritimati): - fix the expected data at the skip of New Year's Eve 1994. - [Bug #14655] - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - test/ruby/test_time_tz.rb | 17 ++++++++++++++--- - 1 file changed, 14 insertions(+), 3 deletions(-) - -diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb -index 39b830d28a3d..dfe139033ed3 100644 ---- a/test/ruby/test_time_tz.rb -+++ b/test/ruby/test_time_tz.rb -@@ -89,6 +89,9 @@ def group_by(e, &block) - Time.local(1951, 5, 6, 1, 0, 0).dst? # DST with fixed tzdata - end - } -+ CORRECT_KIRITIMATI_SKIP_1994 = with_tz("Pacific/Kiritimati") { -+ Time.local(1994, 12, 31, 0, 0, 0).year == 1995 -+ } - - def time_to_s(t) - t.to_s -@@ -178,9 +181,17 @@ def test_europe_lisbon - - def test_pacific_kiritimati - with_tz(tz="Pacific/Kiritimati") { -- assert_time_constructor(tz, "1994-12-31 23:59:59 -1000", :local, [1994,12,31,23,59,59]) -- assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,1,0,0,0]) -- assert_time_constructor(tz, "1995-01-02 23:59:59 +1400", :local, [1995,1,1,23,59,59]) -+ assert_time_constructor(tz, "1994-12-30 00:00:00 -1000", :local, [1994,12,30,0,0,0]) -+ assert_time_constructor(tz, "1994-12-30 23:59:59 -1000", :local, [1994,12,30,23,59,59]) -+ if CORRECT_KIRITIMATI_SKIP_1994 -+ assert_time_constructor(tz, "1995-01-01 00:00:00 +1400", :local, [1994,12,31,0,0,0]) -+ assert_time_constructor(tz, "1995-01-01 23:59:59 +1400", :local, [1994,12,31,23,59,59]) -+ assert_time_constructor(tz, "1995-01-01 00:00:00 +1400", :local, [1995,1,1,0,0,0]) -+ else -+ assert_time_constructor(tz, "1994-12-31 23:59:59 -1000", :local, [1994,12,31,23,59,59]) -+ assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,1,0,0,0]) -+ assert_time_constructor(tz, "1995-01-02 23:59:59 +1400", :local, [1995,1,1,23,59,59]) -+ end - assert_time_constructor(tz, "1995-01-02 00:00:00 +1400", :local, [1995,1,2,0,0,0]) - } - end --- - -From a0e6607a8172f9eaf9a15f03065736deb2035771 Mon Sep 17 00:00:00 2001 -From: nobu -Date: Sun, 1 Apr 2018 13:16:14 +0000 -Subject: [PATCH] test_time_tz.rb: Lisbon tzdata fix - -* test/ruby/test_time_tz.rb (gen_variational_zdump_test): Update - Lisbon zdump data, which fixed the 1912-01-01 transition for - Portugual and its colonies. [Bug #14655] - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - test/ruby/test_time_tz.rb | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb -index ac5f81892878..b32caff9c539 100644 ---- a/test/ruby/test_time_tz.rb -+++ b/test/ruby/test_time_tz.rb -@@ -434,5 +434,6 @@ def self.gen_variational_zdump_test(hint, data) - gen_variational_zdump_test "lisbon", <<'End' if has_lisbon_tz - Europe/Lisbon Mon Jan 1 00:36:31 1912 UTC = Sun Dec 31 23:59:59 1911 LMT isdst=0 gmtoff=-2192 - Europe/Lisbon Mon Jan 1 00:36:44 1912 UT = Sun Dec 31 23:59:59 1911 LMT isdst=0 gmtoff=-2205 -+Europe/Lisbon Sun Dec 31 23:59:59 1911 UT = Sun Dec 31 23:23:14 1911 LMT isdst=0 gmtoff=-2205 - End - end diff --git a/ruby.spec b/ruby.spec index 0f8b9ad..5721567 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,6 +1,6 @@ %global major_version 2 %global minor_version 5 -%global teeny_version 1 +%global teeny_version 3 %global major_minor_version %{major_version}.%{minor_version} %global ruby_version %{major_minor_version}.%{teeny_version} @@ -21,7 +21,7 @@ %endif -%global release 93 +%global release 94 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory three, since the @@ -42,7 +42,7 @@ %global json_version 2.1.0 %global minitest_version 5.10.3 %global net_telnet_version 0.1.1 -%global openssl_version 2.1.0 +%global openssl_version 2.1.2 %global power_assert_version 1.1.1 %global psych_version 3.0.2 %global rake_version 12.3.0 @@ -135,9 +135,6 @@ Patch9: ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch # Add Gem.operating_system_defaults to allow packagers to override defaults. # https://github.com/rubygems/rubygems/pull/2116 Patch10: ruby-2.5.0-Add-Gem.operating_system_defaults.patch -# TestTimeTZ test failures Kiritimati and Lisbon -# https://bugs.ruby-lang.org/issues/14655 -Patch11: ruby-2.5.1-TestTimeTZ-test-failures-Kiritimati-and-Lisbon.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -521,7 +518,6 @@ rm -rf ext/fiddle/libffi* %patch7 -p1 %patch9 -p1 %patch10 -p1 -%patch11 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -1064,6 +1060,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Fri Oct 19 2018 Jun Aruga - 2.5.3-94 +- Update to Ruby 2.5.3. + * Thu May 10 2018 Pavel Valena - 2.5.1-93 - Add macros to edit files lists in .gemspec (gemspec_add_file and gemspec_remove_file). diff --git a/sources b/sources index 7ef486c..5927406 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ruby-2.5.1.tar.xz) = 31bacf58469953282cd5d8b51862dcf4b84dedb927c1871bc3fca32fc157fe49187631575a70838705fe246f4555647577a7ecc26894445a7d64de5503dc11b4 +SHA512 (ruby-2.5.3.tar.xz) = 6dcae0e8d0bacdb2cbde636e2030596308b5af53f2eb85d3adccb67b02e6f8f9751e8117d12f8484829fdd9d995f6e327f701d9b433bcf94f1f59d13a1fd7518 From 635d5da78ad2e680f0c980e5184a23041284fc37 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Wed, 18 Jul 2018 18:33:31 +0200 Subject: [PATCH 14/21] Fix: return default path with nonexistent home dir --- operating_system.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/operating_system.rb b/operating_system.rb index 0d4b1f0..d95b303 100644 --- a/operating_system.rb +++ b/operating_system.rb @@ -119,6 +119,7 @@ module Gem def default_path path = default_dirs.collect {|location, paths| paths[:gem_dir]} path.unshift Gem.user_dir if File.exist? Gem.user_home + path end def default_ext_dir_for base_dir From 8d5dac162ba1a305a2edc40f57a53c010bd57752 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 3 Aug 2018 23:16:47 +0200 Subject: [PATCH 15/21] Fix typo. --- ruby.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby.spec b/ruby.spec index 5721567..57a8f9e 100644 --- a/ruby.spec +++ b/ruby.spec @@ -24,7 +24,7 @@ %global release 94 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} -# The RubyGems library has to stay out of Ruby directory three, since the +# The RubyGems library has to stay out of Ruby directory tree, since the # RubyGems should be share by all Ruby implementations. %global rubygems_dir %{_datadir}/rubygems From 7ef1dd81dce3570e23a88e988cd08d11cdbe014b Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Fri, 26 Oct 2018 19:15:46 +0200 Subject: [PATCH 16/21] Use official URL for Source0. --- ruby.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby.spec b/ruby.spec index 57a8f9e..4699597 100644 --- a/ruby.spec +++ b/ruby.spec @@ -81,7 +81,7 @@ Group: Development/Languages # UCD: some of enc/trans/**/*.src License: (Ruby or BSD) and Public Domain and MIT and CC0 and zlib and UCD URL: http://ruby-lang.org/ -Source0: ftp://ftp.ruby-lang.org/pub/%{name}/%{major_minor_version}/%{ruby_archive}.tar.xz +Source0: https://cache.ruby-lang.org/pub/%{name}/%{major_minor_version}/%{ruby_archive}.tar.xz Source1: operating_system.rb # TODO: Try to push SystemTap support upstream. Source2: libruby.stp From 88f18e8a6a3cfbe0a350547e0d6cff7f92789965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 13 Nov 2018 10:20:09 +0100 Subject: [PATCH 17/21] Fix Tokyo TZ tests. --- ruby-2.6.0-Update-for-tzdata-2018f.patch | 44 ++++++++++++++++++++++++ ruby.spec | 9 ++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 ruby-2.6.0-Update-for-tzdata-2018f.patch diff --git a/ruby-2.6.0-Update-for-tzdata-2018f.patch b/ruby-2.6.0-Update-for-tzdata-2018f.patch new file mode 100644 index 0000000..edc58b6 --- /dev/null +++ b/ruby-2.6.0-Update-for-tzdata-2018f.patch @@ -0,0 +1,44 @@ +From e71ca6cdcf108e6a2fa47ec9fadefe7554717908 Mon Sep 17 00:00:00 2001 +From: nobu +Date: Fri, 26 Oct 2018 01:47:09 +0000 +Subject: [PATCH] Update for tzdata-2018f + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/ruby/test_time_tz.rb | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb +index 2da4fd8d9ce4..328fde48fc34 100644 +--- a/test/ruby/test_time_tz.rb ++++ b/test/ruby/test_time_tz.rb +@@ -86,7 +86,9 @@ def group_by(e, &block) + has_lisbon_tz &&= have_tz_offset?("Europe/Lisbon") + CORRECT_TOKYO_DST_1951 = with_tz("Asia/Tokyo") { + if Time.local(1951, 5, 6, 12, 0, 0).dst? # noon, DST +- Time.local(1951, 5, 6, 1, 0, 0).dst? # DST with fixed tzdata ++ if Time.local(1951, 5, 6, 1, 0, 0).dst? # DST with fixed tzdata ++ Time.local(1951, 9, 8, 23, 0, 0).dst? ? "2018f" : "2018e" ++ end + end + } + CORRECT_KIRITIMATI_SKIP_1994 = with_tz("Pacific/Kiritimati") { +@@ -347,12 +349,16 @@ def self.gen_zdump_test(data) + Asia/Singapore Thu Dec 31 16:29:59 1981 UTC = Thu Dec 31 23:59:59 1981 SGT isdst=0 gmtoff=27000 + Asia/Singapore Thu Dec 31 16:30:00 1981 UTC = Fri Jan 1 00:30:00 1982 SGT isdst=0 gmtoff=28800 + End +- gen_zdump_test CORRECT_TOKYO_DST_1951 ? <<'End' : <<'End' ++ gen_zdump_test CORRECT_TOKYO_DST_1951 ? <<'End' + (CORRECT_TOKYO_DST_1951 < "2018f" ? <<'2018e' : <<'2018f') : <<'End' + Asia/Tokyo Sat May 5 14:59:59 1951 UTC = Sat May 5 23:59:59 1951 JST isdst=0 gmtoff=32400 + Asia/Tokyo Sat May 5 15:00:00 1951 UTC = Sun May 6 01:00:00 1951 JDT isdst=1 gmtoff=36000 ++End + Asia/Tokyo Sat Sep 8 13:59:59 1951 UTC = Sat Sep 8 23:59:59 1951 JDT isdst=1 gmtoff=36000 + Asia/Tokyo Sat Sep 8 14:00:00 1951 UTC = Sat Sep 8 23:00:00 1951 JST isdst=0 gmtoff=32400 +-End ++2018e ++Asia/Tokyo Sat Sep 8 14:59:59 1951 UTC = Sun Sep 9 00:59:59 1951 JDT isdst=1 gmtoff=36000 ++Asia/Tokyo Sat Sep 8 15:00:00 1951 UTC = Sun Sep 9 00:00:00 1951 JST isdst=0 gmtoff=32400 ++2018f + Asia/Tokyo Sat May 5 16:59:59 1951 UTC = Sun May 6 01:59:59 1951 JST isdst=0 gmtoff=32400 + Asia/Tokyo Sat May 5 17:00:00 1951 UTC = Sun May 6 03:00:00 1951 JDT isdst=1 gmtoff=36000 + Asia/Tokyo Fri Sep 7 15:59:59 1951 UTC = Sat Sep 8 01:59:59 1951 JDT isdst=1 gmtoff=36000 diff --git a/ruby.spec b/ruby.spec index 4699597..b1f4cd3 100644 --- a/ruby.spec +++ b/ruby.spec @@ -21,7 +21,7 @@ %endif -%global release 94 +%global release 95 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory tree, since the @@ -135,6 +135,9 @@ Patch9: ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch # Add Gem.operating_system_defaults to allow packagers to override defaults. # https://github.com/rubygems/rubygems/pull/2116 Patch10: ruby-2.5.0-Add-Gem.operating_system_defaults.patch +# Fix Tokyo TZ tests. +# https://github.com/ruby/ruby/commit/e71ca6cdcf108e6a2fa47ec9fadefe7554717908 +Patch25: ruby-2.6.0-Update-for-tzdata-2018f.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -518,6 +521,7 @@ rm -rf ext/fiddle/libffi* %patch7 -p1 %patch9 -p1 %patch10 -p1 +%patch25 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -1060,6 +1064,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Tue Nov 13 2018 Vít Ondruch - 2.5.3-95 +- Fix Tokyo TZ tests. + * Fri Oct 19 2018 Jun Aruga - 2.5.3-94 - Update to Ruby 2.5.3. From b3a221de6e338cdca59fedb27f19f176ee4c0ed7 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Thu, 10 Jan 2019 17:05:28 +0100 Subject: [PATCH 18/21] Refresh expired certificates to fix FTBFS. --- ruby-2.6.0-Try-to-update-cert.patch | 502 ++++++++++++++++++++++++++++ ruby.spec | 8 +- 2 files changed, 509 insertions(+), 1 deletion(-) create mode 100644 ruby-2.6.0-Try-to-update-cert.patch diff --git a/ruby-2.6.0-Try-to-update-cert.patch b/ruby-2.6.0-Try-to-update-cert.patch new file mode 100644 index 0000000..013688d --- /dev/null +++ b/ruby-2.6.0-Try-to-update-cert.patch @@ -0,0 +1,502 @@ +From f234e6c3d3170f37508e214cdaef78d4b2584e5a Mon Sep 17 00:00:00 2001 +From: kazu +Date: Wed, 2 Jan 2019 03:08:20 +0000 +Subject: [PATCH 1/2] Try to update cert + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/net/fixtures/cacert.pem | 86 +++++++------------------- + test/net/fixtures/server.crt | 113 +++++++++++++++++++++++------------ + test/net/fixtures/server.key | 43 ++++++++----- + 3 files changed, 124 insertions(+), 118 deletions(-) + +diff --git a/test/net/fixtures/cacert.pem b/test/net/fixtures/cacert.pem +index 7073387877..f623bd62ed 100644 +--- a/test/net/fixtures/cacert.pem ++++ b/test/net/fixtures/cacert.pem +@@ -1,66 +1,24 @@ +-Certificate: +- Data: +- Version: 3 (0x2) +- Serial Number: +- b9:90:a2:bf:62:69:17:9c +- Signature Algorithm: sha1WithRSAEncryption +- Issuer: C=JP, ST=Shimane, L=Matz-e city, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org +- Validity +- Not Before: Jan 3 01:34:17 2014 GMT +- Not After : Jan 2 01:34:17 2019 GMT +- Subject: C=JP, ST=Shimane, L=Matz-e city, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org +- Subject Public Key Info: +- Public Key Algorithm: rsaEncryption +- RSA Public Key: (1024 bit) +- Modulus (1024 bit): +- 00:db:75:d0:45:de:b1:df:bf:71:a0:0e:b0:a5:e6: +- bc:f4:1c:9d:e5:25:67:64:c5:7b:cb:f1:af:c6:be: +- 9a:aa:ea:7e:0f:cc:05:af:ef:40:69:06:b2:c9:13: +- 9d:7e:eb:a2:06:e2:ea:7d:07:c7:c7:99:c7:fb:d5: +- b8:eb:63:77:62:2b:18:12:c3:53:58:d0:f5:c7:40: +- 0c:01:d1:26:82:34:16:09:e3:dc:65:f4:dc:bb:5d: +- a5:41:60:e7:a9:74:ba:d7:4c:b6:a3:9c:c5:8c:89: +- af:cb:e8:9f:05:fe:ea:fe:64:24:bf:e7:ed:e3:f6: +- d0:fc:d6:eb:fc:06:82:10:fb +- Exponent: 65537 (0x10001) +- X509v3 extensions: +- X509v3 Subject Key Identifier: +- E8:7E:58:AC:13:7B:03:22:8D:9E:AF:32:0B:84:89:80:80:0C:1E:C2 +- X509v3 Authority Key Identifier: +- keyid:E8:7E:58:AC:13:7B:03:22:8D:9E:AF:32:0B:84:89:80:80:0C:1E:C2 +- DirName:/C=JP/ST=Shimane/L=Matz-e city/O=Ruby Core Team/CN=Ruby Test CA/emailAddress=security@ruby-lang.org +- serial:B9:90:A2:BF:62:69:17:9C +- +- X509v3 Basic Constraints: +- CA:TRUE +- Signature Algorithm: sha1WithRSAEncryption +- 8f:77:06:4e:31:72:12:ee:68:09:70:27:d4:31:85:ef:10:95: +- f9:0f:2b:66:63:08:37:88:6e:b7:9b:40:3e:18:77:33:86:e8: +- 61:6a:b7:3c:cb:c7:a6:d6:d5:92:6a:1f:56:d0:9f:5c:32:56: +- d3:37:52:fe:0e:20:c2:7a:0d:fe:2d:3c:81:da:b8:7f:4d:6a: +- 08:01:d9:be:7a:a2:15:be:a6:ce:49:64:90:8c:9a:ca:6e:2e: +- 84:48:1d:94:19:56:94:46:aa:25:9b:68:c2:80:60:bf:cb:2e: +- 35:03:ea:0a:65:5a:33:38:c6:cc:81:46:c0:bc:36:86:96:39: +- 10:7d + -----BEGIN CERTIFICATE----- +-MIIDjTCCAvagAwIBAgIJALmQor9iaRecMA0GCSqGSI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4EFgQU9tEiKdU9 ++I9derQyc5nWPnc34nVMwHwYDVR0jBBgwFoAU9tEiKdU9I9derQyc5nWPnc34nVMw ++DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAxj7F/u3C3fgq24N7hGRA ++of7ClFQxGmo/IGT0AISzW3HiVYiFaikKhbO1NwD9aBpD8Zwe62sCqMh8jGV/b0+q ++aOORnWYNy2R6r9FkASAglmdF6xn3bhgGD5ls4pCvcG9FynGnGc24g6MrjFNrBYUS ++2iIZsg36i0IJswo/Dy6HLphCms2BMCD3DeWtfjePUiTmQHJo6HsQIKP/u4N4Fvee ++uMBInei2M4VU74fLXbmKl1F9AEX7JDP3BKSZG19Ch5pnUo4uXM1uNTGsi07P4Y0s ++K44+SKBC0bYEFbDK0eQWMrX3kIhkPxyIWhxdq9/NqPYjShuSEAhA6CSpmRg0pqc+ ++mA== + -----END CERTIFICATE----- +diff --git a/test/net/fixtures/server.crt b/test/net/fixtures/server.crt +index fa4f99493a..817ecc222c 100644 +--- a/test/net/fixtures/server.crt ++++ b/test/net/fixtures/server.crt +@@ -1,48 +1,83 @@ + Certificate: + Data: +- Version: 1 (0x0) +- Serial Number: 0 (0x0) +- Signature Algorithm: sha1WithRSAEncryption ++ Version: 3 (0x2) ++ Serial Number: 1 (0x1) ++ Signature Algorithm: sha256WithRSAEncryption + Issuer: C=JP, ST=Shimane, L=Matz-e city, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org + Validity +- Not Before: Jan 3 01:34:17 2014 GMT +- Not After : Jan 2 01:34:17 2019 GMT +- Subject: C=JP, ST=Shimane, O=Ruby Core Team, OU=Ruby Test, CN=localhost ++ Not Before: Jan 2 03:06:53 2019 GMT ++ Not After : Jan 1 03:06:53 2024 GMT ++ Subject: C=JP, ST=Shimane, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org + Subject Public Key Info: + Public Key Algorithm: rsaEncryption +- RSA Public Key: (1024 bit) +- Modulus (1024 bit): +- 00:db:75:d0:45:de:b1:df:bf:71:a0:0e:b0:a5:e6: +- bc:f4:1c:9d:e5:25:67:64:c5:7b:cb:f1:af:c6:be: +- 9a:aa:ea:7e:0f:cc:05:af:ef:40:69:06:b2:c9:13: +- 9d:7e:eb:a2:06:e2:ea:7d:07:c7:c7:99:c7:fb:d5: +- b8:eb:63:77:62:2b:18:12:c3:53:58:d0:f5:c7:40: +- 0c:01:d1:26:82:34:16:09:e3:dc:65:f4:dc:bb:5d: +- a5:41:60:e7:a9:74:ba:d7:4c:b6:a3:9c:c5:8c:89: +- af:cb:e8:9f:05:fe:ea:fe:64:24:bf:e7:ed:e3:f6: +- d0:fc:d6:eb:fc:06:82:10:fb ++ Public-Key: (2048 bit) ++ Modulus: ++ 00:c1:a9:64:ef:d3:f2:e1:1a:7f:24:df:7f:65:86: ++ c1:98:55:16:83:91:16:5b:63:6e:26:bb:c0:73:68: ++ 7b:f7:00:ba:37:db:7f:a9:5c:c8:98:aa:43:96:87: ++ e1:a0:63:69:0c:d8:22:90:f5:56:22:b1:57:6e:71: ++ 3b:30:04:d0:64:4d:38:33:a0:ea:c1:16:3d:16:be: ++ c0:49:4c:f0:14:15:af:09:95:da:bf:c7:23:34:c3: ++ 7d:af:b7:70:b3:6d:1b:de:21:93:c0:7c:6c:0e:fd: ++ 0e:e5:ff:f3:80:51:0c:df:80:7c:40:46:c9:ca:57: ++ d4:88:02:0f:f0:1e:14:18:f1:98:0f:c6:42:1d:cc: ++ 90:29:71:1b:af:4a:22:e0:e7:86:fc:dd:d3:d8:84: ++ 0e:5e:f0:9b:93:5f:0a:9a:1d:f8:f5:f3:e7:c7:b0: ++ 7a:0e:25:20:13:02:1a:22:c2:d9:e0:7f:4f:a1:7f: ++ 72:f6:e6:e1:14:7c:c5:93:7f:a6:96:3b:ab:d8:f1: ++ dc:2b:01:d6:e5:fe:5c:cf:08:db:06:e9:fd:7d:bd: ++ fe:2c:f4:8a:7b:9f:15:88:05:2e:f7:ba:c9:86:7e: ++ 14:50:f4:96:a1:84:17:5d:f7:8b:0a:7a:14:2c:de: ++ ca:00:74:f8:23:32:9d:66:af:1c:a6:58:1a:de:82: ++ 96:a9 + Exponent: 65537 (0x10001) +- Signature Algorithm: sha1WithRSAEncryption +- 85:f5:d3:05:8b:8c:f4:43:1c:88:f2:8f:b2:f2:93:77:b7:3d: +- 95:c6:a0:34:bc:33:6a:d8:85:5f:3e:86:08:10:c5:5c:c1:76: +- a3:53:3c:dc:38:98:23:97:e7:da:21:ac:e8:4d:3c:96:70:29: +- ff:ff:1e:4a:9a:17:2b:db:04:62:b9:ef:ab:ea:a7:a5:e8:7c: +- b1:d5:ed:30:a8:6c:78:de:51:7e:e3:8a:c2:a4:64:a8:63:a2: +- bc:fd:43:9c:f3:55:7d:54:c9:6a:d8:53:1c:4b:6b:03:aa:b6: +- 19:e6:a4:4f:47:00:96:c5:42:59:85:4e:c3:4e:cd:41:82:53: +- 10:f8 ++ X509v3 extensions: ++ X509v3 Basic Constraints: ++ CA:FALSE ++ Netscape Comment: ++ OpenSSL Generated Certificate ++ X509v3 Subject Key Identifier: ++ F2:C9:35:05:31:EF:08:EE:EF:B0:FE:1A:72:C2:9E:70:E3:E3:EC:43 ++ X509v3 Authority Key Identifier: ++ keyid:F6:D1:22:29:D5:3D:23:D7:5E:AD:0C:9C:E6:75:8F:9D:CD:F8:9D:53 ++ ++ Signature Algorithm: sha256WithRSAEncryption ++ 02:e7:0a:22:7c:5e:d9:92:d2:b9:fb:4a:bf:75:3f:00:e6:19: ++ 3e:90:a5:9d:38:41:82:4c:6f:b9:f3:f2:58:a1:91:7f:4a:d4: ++ 28:38:9c:7c:4d:6c:2f:2f:95:f5:55:55:25:a1:71:0c:05:42: ++ 08:a3:a6:ab:e3:04:47:9a:42:24:8f:b2:ba:50:55:af:b8:d7: ++ fc:1a:13:92:5d:75:7d:e1:4d:87:5e:57:82:c5:5f:d6:b8:ea: ++ 86:4e:05:b0:7f:07:27:a5:36:1f:1e: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d94sKehQs3soAdPgjMp1mrxymWBregpapAgMBAAGjezB5 ++MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENl ++cnRpZmljYXRlMB0GA1UdDgQWBBTyyTUFMe8I7u+w/hpywp5w4+PsQzAfBgNVHSME ++GDAWgBT20SIp1T0j116tDJzmdY+dzfidUzANBgkqhkiG9w0BAQsFAAOCAQEAAucK ++Inxe2ZLSuftKv3U/AOYZPpClnThBgkxvufPyWKGRf0rUKDicfE1sLy+V9VVVJaFx ++DAVCCKOmq+MER5pCJI+yulBVr7jX/BoTkl11feFNh15XgsVf1rjqhk4FsH8HJ6U2 ++Hx5U8TI1f5x1JmohdTcyu4kBeJfM09466M5F7RIkLqglc7PNcEe4gfkGqo2HL6nN ++/nlAzMlHPS+CwoK/XYoGW6mQ07Cn/PMa+w7Lj9jyTvSNu0vVLSDAbtUIK4EyxODS ++SzEn8VWWDtS5kgJxmGnlc8xSRaAH+yiesPyxWEJaCEowSeXxpcjVimfw7Z4/G3Gm ++gJGByxo9tY6HnWQozg== + -----END CERTIFICATE----- +diff --git a/test/net/fixtures/server.key b/test/net/fixtures/server.key +index 7c57546ece..1e73232728 100644 +--- a/test/net/fixtures/server.key ++++ b/test/net/fixtures/server.key +@@ -1,15 +1,28 @@ +------BEGIN RSA PRIVATE KEY----- +-MIICXQIBAAKBgQDbddBF3rHfv3GgDrCl5rz0HJ3lJWdkxXvL8a/Gvpqq6n4PzAWv +-70BpBrLJE51+66IG4up9B8fHmcf71bjrY3diKxgSw1NY0PXHQAwB0SaCNBYJ49xl +-9Ny7XaVBYOepdLrXTLajnMWMia/L6J8F/ur+ZCS/5+3j9tD81uv8BoIQ+wIDAQAB +-AoGAGtYHR+P5gFDaxiXFuCPFC1zMeg7e29XCU6gURIteQnQ2QhxCvcbV64HkLu51 +-HeYWhB0Pa4aeCWxmpgb2e+JH4MEoIjeJSGyZQeqwkQLgWJDdvkgWx5am58QzA60I +-ip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SkvkWuEQfQFZUDTyLodwVQAT5aR+mcr4Qml ++uCiVeqoPl+JIg4m8Tz76XWo= ++-----END PRIVATE KEY----- +-- +2.20.1 + + +From 1e0b49a293d3792826c67b7e05c5fcbd09c9ea6e Mon Sep 17 00:00:00 2001 +From: kazu +Date: Wed, 2 Jan 2019 03:29:01 +0000 +Subject: [PATCH 2/2] Try to update cert (2nd try) + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + test/net/fixtures/server.crt | 115 +++++++++++++++++------------------ + test/net/fixtures/server.key | 52 ++++++++-------- + 2 files changed, 83 insertions(+), 84 deletions(-) + +diff --git a/test/net/fixtures/server.crt b/test/net/fixtures/server.crt +index 817ecc222c..5ca78a6d14 100644 +--- a/test/net/fixtures/server.crt ++++ b/test/net/fixtures/server.crt +@@ -1,35 +1,35 @@ + Certificate: + Data: + Version: 3 (0x2) +- Serial Number: 1 (0x1) ++ Serial Number: 2 (0x2) + Signature Algorithm: sha256WithRSAEncryption + Issuer: C=JP, ST=Shimane, L=Matz-e city, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org + Validity +- Not Before: Jan 2 03:06:53 2019 GMT +- Not After : Jan 1 03:06:53 2024 GMT +- Subject: C=JP, ST=Shimane, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org ++ Not Before: Jan 2 03:27:13 2019 GMT ++ Not After : Jan 1 03:27:13 2024 GMT ++ Subject: C=JP, ST=Shimane, O=Ruby Core Team, OU=Ruby Test, CN=localhost + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (2048 bit) + Modulus: +- 00:c1:a9:64:ef:d3:f2:e1:1a:7f:24:df:7f:65:86: +- c1:98:55:16:83:91:16:5b:63:6e:26:bb:c0:73:68: +- 7b:f7:00:ba:37:db:7f:a9:5c:c8:98:aa:43:96:87: +- e1:a0:63:69:0c:d8:22:90:f5:56:22:b1:57:6e:71: +- 3b:30:04:d0:64:4d:38:33:a0:ea:c1:16:3d:16:be: +- c0:49:4c:f0:14:15:af:09:95:da:bf:c7:23:34:c3: +- 7d:af:b7:70:b3:6d:1b:de:21:93:c0:7c:6c:0e:fd: +- 0e:e5:ff:f3:80:51:0c:df:80:7c:40:46:c9:ca:57: +- d4:88:02:0f:f0:1e:14:18:f1:98:0f:c6:42:1d:cc: +- 90:29:71:1b:af:4a:22:e0:e7:86:fc:dd:d3:d8:84: +- 0e:5e:f0:9b:93:5f:0a:9a:1d:f8:f5:f3:e7:c7:b0: +- 7a:0e:25:20:13:02:1a:22:c2:d9:e0:7f:4f:a1:7f: +- 72:f6:e6:e1:14:7c:c5:93:7f:a6:96:3b:ab:d8:f1: +- dc:2b:01:d6:e5:fe:5c:cf:08:db:06:e9:fd:7d:bd: +- fe:2c:f4:8a:7b:9f:15:88:05:2e:f7:ba:c9:86:7e: +- 14:50:f4:96:a1:84:17:5d:f7:8b:0a:7a:14:2c:de: +- ca:00:74:f8:23:32:9d:66:af:1c:a6:58:1a:de:82: +- 96:a9 ++ 00:e8:da:9c:01:2e:2b:10:ec:49:cd:5e:07:13:07: ++ 9c:70:9e:c6:74:bc:13:c2:e1:6f:c6:82:fd:e3:48: ++ e0:2c:a5:68:c7:9e:42:de:60:54:65:e6:6a:14:57: ++ 7a:30:d0:cc:b5:b6:d9:c3:d2:df:c9:25:97:54:67: ++ cf:f6:be:5e:cb:8b:ee:03:c5:e1:e2:f9:e7:f7:d1: ++ 0c:47:f0:b8:da:33:5a:ad:41:ad:e7:b5:a2:7b:b7: ++ bf:30:da:60:f8:e3:54:a2:bc:3a:fd:1b:74:d9:dc: ++ 74:42:e9:29:be:df:ac:b4:4f:eb:32:f4:06:f1:e1: ++ 8c:4b:a8:8b:fb:29:e7:b1:bf:1d:01:ee:73:0f:f9: ++ 40:dc:d5:15:79:d9:c6:73:d0:c0:dd:cb:e4:da:19: ++ 47:80:c6:14:04:72:fd:9a:7c:8f:11:82:76:49:04: ++ 79:cc:f2:5c:31:22:95:13:3e:5d:40:a6:4d:e0:a3: ++ 02:26:7d:52:3b:bb:ed:65:a1:0f:ed:6b:b0:3c:d4: ++ de:61:15:5e:d3:dd:68:09:9f:4a:57:a5:c2:a9:6d: ++ 86:92:c5:f4:a4:d4:b7:13:3b:52:63:24:05:e2:cc: ++ e3:8a:3c:d4:35:34:2b:10:bb:58:72:e7:e1:8d:1d: ++ 74:8c:61:16:20:3d:d0:1c:4e:8f:6e:fd:fe:64:10: ++ 4f:41 + Exponent: 65537 (0x10001) + X509v3 extensions: + X509v3 Basic Constraints: +@@ -37,47 +37,46 @@ Certificate: + Netscape Comment: + OpenSSL Generated Certificate + X509v3 Subject Key Identifier: +- F2:C9:35:05:31:EF:08:EE:EF:B0:FE:1A:72:C2:9E:70:E3:E3:EC:43 ++ ED:28:C2:7E:AB:4B:C8:E8:FE:55:6D:66:95:31:1C:2D:60:F9:02:36 + X509v3 Authority Key Identifier: + keyid:F6:D1:22:29:D5:3D:23:D7:5E:AD:0C:9C:E6:75:8F:9D:CD:F8:9D:53 + + Signature Algorithm: sha256WithRSAEncryption +- 02:e7:0a:22:7c:5e:d9:92:d2:b9:fb:4a:bf:75:3f:00:e6:19: +- 3e:90:a5:9d:38:41:82:4c:6f:b9:f3:f2:58:a1:91:7f:4a:d4: +- 28:38:9c:7c:4d:6c:2f:2f:95:f5:55:55:25:a1:71:0c:05:42: +- 08:a3:a6:ab:e3:04:47:9a:42:24:8f:b2:ba:50:55:af:b8:d7: +- fc:1a:13:92:5d:75:7d:e1:4d:87:5e:57:82:c5:5f:d6:b8:ea: +- 86:4e:05:b0:7f:07:27:a5:36:1f:1e:54:f1:32:35:7f:9c:75: +- 26:6a:21:75:37:32:bb:89:01:78:97:cc:d3:de:3a:e8:ce:45: +- ed:12:24:2e:a8:25:73:b3:cd:70:47:b8:81:f9:06:aa:8d:87: +- 2f:a9:cd:fe:79:40:cc:c9:47:3d:2f:82:c2:82:bf:5d:8a:06: +- 5b:a9:90:d3:b0:a7:fc:f3:1a:fb:0e:cb:8f:d8:f2:4e:f4:8d: +- bb:4b:d5:2d:20:c0:6e:d5:08:2b:81:32:c4:e0:d2:4b:31:27: +- f1:55:96:0e:d4:b9:92:02:71:98:69:e5:73:cc:52:45:a0:07: +- fb:28:9e:b0:fc:b1:58:42:5a:08:4a:30:49:e5:f1:a5:c8:d5: +- 8a:67:f0:ed:9e:3f:1b:71:a6:80:91:81:cb:1a:3d:b5:8e:87: +- 9d:64:28:ce ++ 1d:b8:c5:8b:72:41:20:65:ad:27:6f:15:63:06:26:12:8d:9c: ++ ad:ca:f4:db:97:b4:90:cb:ff:35:94:bb:2a:a7:a1:ab:1e:35: ++ 2d:a5:3f:c9:24:b0:1a:58:89:75:3e:81:0a:2c:4f:98:f9:51: ++ fb:c0:a3:09:d0:0a:9b:e7:a2:b7:c3:60:40:c8:f4:6d:b2:6a: ++ 56:12:17:4c:00:24:31:df:9c:60:ae:b1:68:54:a9:e6:b5:4a: ++ 04:e6:92:05:86:d9:5a:dc:96:30:a5:58:de:14:99:0f:e5:15: ++ 89:3e:9b:eb:80:e3:bd:83:c3:ea:33:35:4b:3e:2f:d3:0d:64: ++ 93:67:7f:8d:f5:3f:0c:27:bc:37:5a:cc:d6:47:16:af:5a:62: ++ d2:da:51:f8:74:06:6b:24:ad:28:68:08:98:37:7d:ed:0e:ab: ++ 1e:82:61:05:d0:ba:75:a0:ab:21:b0:9a:fd:2b:54:86:1d:0d: ++ 1f:c2:d4:77:1f:72:26:5e:ad:8a:9f:09:36:6d:44:be:74:c2: ++ 5a:3e:ff:5c:9d:75:d6:38:7b:c5:39:f9:44:6e:a1:d1:8e:ff: ++ 63:db:c4:bb:c6:91:92:ca:5c:60:9b:1d:eb:0a:de:08:ee:bf: ++ da:76:03:65:62:29:8b:f8:7f:c7:86:73:1e:f6:1f:2d:89:69: ++ fd:be:bd:6e + -----BEGIN CERTIFICATE----- +-MIID+TCCAuGgAwIBAgIBATANBgkqhkiG9w0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WNhdGUwHQYDVR0OBBYEFO0o ++wn6rS8jo/lVtZpUxHC1g+QI2MB8GA1UdIwQYMBaAFPbRIinVPSPXXq0MnOZ1j53N +++J1TMA0GCSqGSIb3DQEBCwUAA4IBAQAduMWLckEgZa0nbxVjBiYSjZytyvTbl7SQ ++y/81lLsqp6GrHjUtpT/JJLAaWIl1PoEKLE+Y+VH7wKMJ0Aqb56K3w2BAyPRtsmpW ++EhdMACQx35xgrrFoVKnmtUoE5pIFhtla3JYwpVjeFJkP5RWJPpvrgOO9g8PqMzVL ++Pi/TDWSTZ3+N9T8MJ7w3WszWRxavWmLS2lH4dAZrJK0oaAiYN33tDqsegmEF0Lp1 ++oKshsJr9K1SGHQ0fwtR3H3ImXq2Knwk2bUS+dMJaPv9cnXXWOHvFOflEbqHRjv9j ++28S7xpGSylxgmx3rCt4I7r/adgNlYimL+H/HhnMe9h8tiWn9vr1u + -----END CERTIFICATE----- +diff --git a/test/net/fixtures/server.key b/test/net/fixtures/server.key +index 1e73232728..7f2380e71e 100644 +--- a/test/net/fixtures/server.key ++++ b/test/net/fixtures/server.key +@@ -1,28 +1,28 @@ + -----BEGIN PRIVATE KEY----- +-MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDBqWTv0/LhGn8k +-339lhsGYVRaDkRZbY24mu8BzaHv3ALo323+pXMiYqkOWh+GgY2kM2CKQ9VYisVdu +-cTswBNBkTTgzoOrBFj0WvsBJTPAUFa8Jldq/xyM0w32vt3CzbRveIZPAfGwO/Q7l +-//OAUQzfgHxARsnKV9SIAg/wHhQY8ZgPxkIdzJApcRuvSiLg54b83dPYhA5e8JuT +-XwqaHfj18+fHsHoOJSATAhoiwtngf0+hf3L25uEUfMWTf6aWO6vY8dwrAdbl/lzP +-CNsG6f19vf4s9Ip7nxWIBS73usmGfhRQ9JahhBdd94sKehQs3soAdPgjMp1mrxym +-WBregpapAgMBAAECggEAYQJ20oBMcSBxwknGqlfnkGRHI97A4UScgACa9fT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wK+KqCTH9qc ++pw/Eb8nB/4XNcpTZu7Fg0Wc+ooUCgYEA8sVaicn1Wxkpb45a4qfrA6wOr5xdJ4cC ++A5qs7vjX2OdPIQOmoQhdI7bCWFXZzF33wA4YCws6j5wRaySLIJqdms8Gl9QnODy1 ++ZlA5gwKToBC/jqPmWAXSKb8EH7cHilaxU9OKnQ7CfwlGLHqjMtjrhR7KHlt3CVRs ++oRmvsjZVXI0CgYAmPedslAO6mMhFSSfULrhMXmV82OCqYrrA6EEkVNGbcdnzAOkD ++gfKIWabDd8bFY10po4Mguy0CHzNhBXIioWQWV5BlbhC1YKMLw+S9DzSdLAKGY9gJ ++xQ4+UQ3wtRQ/k+IYR413RUsW2oFvgZ3KSyNeAb9MK6uuv84VdG/OzVSs/QKBgQDn ++kap//l2EbObiWyaERunckdVcW0lcN+KK75J/TGwPoOwQsLvTpPe65kxRGGrtDsEQ ++uCDk/+v3KkZPLgdrrTAih9FhJ+PVN8tMcb+6IM4SA4fFFr/UPJEwct0LJ3oQ0grJ ++y+HPWFHb/Uurh7t99/4H98uR02sjQh1wOeEmm78mzQKBgQDm+LzGH0se6CXQ6cdZ ++g1JRZeXkDEsrW3hfAsW62xJQmXcWxBoblP9OamMY+A06rM5og3JbDk5Zm6JsOaA8 ++wS2gw4ilp46jors4eQey8ux7kB9LzdBoDBBElnsbjLO8oBNZlVcYXg+6BOl/CUi7 ++2whRF0FEjKA8ehrNhAq+VFfFNw== + -----END PRIVATE KEY----- +-- +2.20.1 + diff --git a/ruby.spec b/ruby.spec index b1f4cd3..1cc9a85 100644 --- a/ruby.spec +++ b/ruby.spec @@ -138,6 +138,10 @@ Patch10: ruby-2.5.0-Add-Gem.operating_system_defaults.patch # Fix Tokyo TZ tests. # https://github.com/ruby/ruby/commit/e71ca6cdcf108e6a2fa47ec9fadefe7554717908 Patch25: ruby-2.6.0-Update-for-tzdata-2018f.patch +# Refresh expired certificates. +# https://bugs.ruby-lang.org/issues/15502 +# https://github.com/ruby/ruby/commit/6f9b40ea53d8f3fb2a5b1c7ac55c207d42c77ef4 +Patch11: ruby-2.6.0-Try-to-update-cert.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -521,6 +525,7 @@ rm -rf ext/fiddle/libffi* %patch7 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 %patch25 -p1 # Provide an example of usage of the tapset: @@ -1064,8 +1069,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog -* Tue Nov 13 2018 Vít Ondruch - 2.5.3-95 +* Fri Jan 11 2019 Jun Aruga - 2.5.3-95 - Fix Tokyo TZ tests. +- Refresh expired certificates to fix FTBFS. * Fri Oct 19 2018 Jun Aruga - 2.5.3-94 - Update to Ruby 2.5.3. From 7b1cb35f6e4190398b1ab1b469847706bd86aaf7 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 4 Apr 2019 13:15:09 +0200 Subject: [PATCH 19/21] Update to Ruby 2.5.5. --- ...-additional-preludes-by-configuratio.patch | 2 +- ...0-Enable-configuration-of-archlibdir.patch | 2 +- ...ed-paths-when-empty-version-string-i.patch | 2 +- ruby-2.1.0-always-use-i386.patch | 2 +- ruby-2.1.0-custom-rubygems-location.patch | 4 +- ruby-2.3.0-ruby_version.patch | 10 +- ....0-Add-Gem.operating_system_defaults.patch | 2 +- ruby-2.6.0-Try-to-update-cert.patch | 502 ------------------ ruby-2.6.0-Update-for-tzdata-2018f.patch | 44 -- ruby.spec | 18 +- sources | 2 +- 11 files changed, 19 insertions(+), 571 deletions(-) delete mode 100644 ruby-2.6.0-Try-to-update-cert.patch delete mode 100644 ruby-2.6.0-Update-for-tzdata-2018f.patch diff --git a/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch b/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch index 47bf9bc..68e4abc 100644 --- a/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch +++ b/ruby-2.1.0-Allow-to-specify-additional-preludes-by-configuratio.patch @@ -39,7 +39,7 @@ diff --git a/configure.ac b/configure.ac index 028ef7ca3e..cdeff87871 100644 --- a/configure.ac +++ b/configure.ac -@@ -4396,6 +4396,13 @@ AC_SUBST(rubyarchhdrdir)dnl +@@ -4397,6 +4397,13 @@ AC_SUBST(rubyarchhdrdir)dnl AC_SUBST(sitearchhdrdir)dnl AC_SUBST(vendorarchhdrdir)dnl diff --git a/ruby-2.1.0-Enable-configuration-of-archlibdir.patch b/ruby-2.1.0-Enable-configuration-of-archlibdir.patch index 36ec460..555b6b5 100644 --- a/ruby-2.1.0-Enable-configuration-of-archlibdir.patch +++ b/ruby-2.1.0-Enable-configuration-of-archlibdir.patch @@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac index 11fc237552..b77e88fc37 100644 --- a/configure.ac +++ b/configure.ac -@@ -3641,6 +3641,11 @@ AS_IF([test ${multiarch+set}], [ +@@ -3642,6 +3642,11 @@ AS_IF([test ${multiarch+set}], [ ]) archlibdir='${libdir}/${arch}' diff --git a/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch b/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch index d0cffab..20539fd 100644 --- a/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch +++ b/ruby-2.1.0-Prevent-duplicated-paths-when-empty-version-string-i.patch @@ -14,7 +14,7 @@ diff --git a/configure.ac b/configure.ac index 999e2d6d5d..11fc237552 100644 --- a/configure.ac +++ b/configure.ac -@@ -4251,7 +4251,8 @@ AS_CASE(["$ruby_version_dir_name"], +@@ -4252,7 +4252,8 @@ AS_CASE(["$ruby_version_dir_name"], ruby_version_dir=/'${ruby_version_dir_name}' if test -z "${ruby_version_dir_name}"; then diff --git a/ruby-2.1.0-always-use-i386.patch b/ruby-2.1.0-always-use-i386.patch index 555ad45..5d45fac 100644 --- a/ruby-2.1.0-always-use-i386.patch +++ b/ruby-2.1.0-always-use-i386.patch @@ -11,7 +11,7 @@ diff --git a/configure.ac b/configure.ac index b77e88fc37..6bba453e3c 100644 --- a/configure.ac +++ b/configure.ac -@@ -4315,6 +4315,8 @@ AC_SUBST(vendorarchdir)dnl +@@ -4316,6 +4316,8 @@ AC_SUBST(vendorarchdir)dnl AC_SUBST(CONFIGURE, "`echo $0 | sed 's|.*/||'`")dnl AC_SUBST(configure_args, "`echo "${ac_configure_args}" | sed 's/\\$/$$/g'`")dnl diff --git a/ruby-2.1.0-custom-rubygems-location.patch b/ruby-2.1.0-custom-rubygems-location.patch index cc45741..4b54560 100644 --- a/ruby-2.1.0-custom-rubygems-location.patch +++ b/ruby-2.1.0-custom-rubygems-location.patch @@ -15,7 +15,7 @@ diff --git a/configure.ac b/configure.ac index 6bba453e3c..028ef7ca3e 100644 --- a/configure.ac +++ b/configure.ac -@@ -4287,6 +4287,10 @@ AC_ARG_WITH(vendorarchdir, +@@ -4288,6 +4288,10 @@ AC_ARG_WITH(vendorarchdir, [vendorarchdir=$withval], [vendorarchdir=${multiarch+'${rubysitearchprefix}/vendor_ruby'${ruby_version_dir}}${multiarch-'${vendorlibdir}/${sitearch}'}]) @@ -26,7 +26,7 @@ index 6bba453e3c..028ef7ca3e 100644 AS_IF([test "${LOAD_RELATIVE+set}"], [ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) RUBY_EXEC_PREFIX='' -@@ -4311,6 +4315,7 @@ AC_SUBST(sitearchdir)dnl +@@ -4312,6 +4316,7 @@ AC_SUBST(sitearchdir)dnl AC_SUBST(vendordir)dnl AC_SUBST(vendorlibdir)dnl AC_SUBST(vendorarchdir)dnl diff --git a/ruby-2.3.0-ruby_version.patch b/ruby-2.3.0-ruby_version.patch index 8f57319..30370e1 100644 --- a/ruby-2.3.0-ruby_version.patch +++ b/ruby-2.3.0-ruby_version.patch @@ -20,7 +20,7 @@ diff --git a/configure.ac b/configure.ac index 8ea969412f..a00f2b6776 100644 --- a/configure.ac +++ b/configure.ac -@@ -4202,9 +4202,6 @@ AS_CASE(["$target_os"], +@@ -4203,9 +4203,6 @@ AS_CASE(["$target_os"], rubyw_install_name='$(RUBYW_INSTALL_NAME)' ]) @@ -30,7 +30,7 @@ index 8ea969412f..a00f2b6776 100644 rubyarchprefix=${multiarch+'${archlibdir}/${RUBY_BASE_NAME}'}${multiarch-'${rubylibprefix}/${arch}'} AC_ARG_WITH(rubyarchprefix, AS_HELP_STRING([--with-rubyarchprefix=DIR], -@@ -4227,56 +4224,62 @@ AC_ARG_WITH(ridir, +@@ -4228,56 +4225,62 @@ AC_ARG_WITH(ridir, AC_SUBST(ridir) AC_SUBST(RI_BASE_NAME) @@ -120,7 +120,7 @@ index 8ea969412f..a00f2b6776 100644 AS_IF([test "${LOAD_RELATIVE+set}"], [ AC_DEFINE_UNQUOTED(LOAD_RELATIVE, $LOAD_RELATIVE) -@@ -4293,6 +4296,7 @@ AC_SUBST(sitearchincludedir)dnl +@@ -4294,6 +4297,7 @@ AC_SUBST(sitearchincludedir)dnl AC_SUBST(arch)dnl AC_SUBST(sitearch)dnl AC_SUBST(ruby_version)dnl @@ -245,7 +245,7 @@ diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 0428bea..b6e090e 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb -@@ -1156,7 +1156,8 @@ def test_self_use_paths +@@ -1191,7 +1191,8 @@ def test_self_use_paths def test_self_user_dir parts = [@userhome, '.gem', Gem.ruby_engine] @@ -255,7 +255,7 @@ index 0428bea..b6e090e 100644 assert_equal File.join(parts), Gem.user_dir end -@@ -1283,7 +1284,7 @@ def test_self_user_home_user_drive_and_path +@@ -1318,7 +1319,7 @@ def test_self_user_home_user_drive_and_path def test_self_vendor_dir expected = File.join RbConfig::CONFIG['vendordir'], 'gems', diff --git a/ruby-2.5.0-Add-Gem.operating_system_defaults.patch b/ruby-2.5.0-Add-Gem.operating_system_defaults.patch index 6838701..7ac0e41 100644 --- a/ruby-2.5.0-Add-Gem.operating_system_defaults.patch +++ b/ruby-2.5.0-Add-Gem.operating_system_defaults.patch @@ -64,7 +64,7 @@ diff --git a/test/rubygems/test_gem.rb b/test/rubygems/test_gem.rb index 3225a05c6b..62b80c4945 100644 --- a/test/rubygems/test_gem.rb +++ b/test/rubygems/test_gem.rb -@@ -1802,6 +1802,13 @@ def test_use_gemdeps_specific +@@ -1837,6 +1837,13 @@ def test_use_gemdeps_specific ENV['RUBYGEMS_GEMDEPS'] = rubygems_gemdeps end diff --git a/ruby-2.6.0-Try-to-update-cert.patch b/ruby-2.6.0-Try-to-update-cert.patch deleted file mode 100644 index 013688d..0000000 --- a/ruby-2.6.0-Try-to-update-cert.patch +++ /dev/null @@ -1,502 +0,0 @@ -From f234e6c3d3170f37508e214cdaef78d4b2584e5a Mon Sep 17 00:00:00 2001 -From: kazu -Date: Wed, 2 Jan 2019 03:08:20 +0000 -Subject: [PATCH 1/2] Try to update cert - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - test/net/fixtures/cacert.pem | 86 +++++++------------------- - test/net/fixtures/server.crt | 113 +++++++++++++++++++++++------------ - test/net/fixtures/server.key | 43 ++++++++----- - 3 files changed, 124 insertions(+), 118 deletions(-) - -diff --git a/test/net/fixtures/cacert.pem b/test/net/fixtures/cacert.pem -index 7073387877..f623bd62ed 100644 ---- a/test/net/fixtures/cacert.pem -+++ b/test/net/fixtures/cacert.pem -@@ -1,66 +1,24 @@ --Certificate: -- Data: -- Version: 3 (0x2) -- Serial Number: -- b9:90:a2:bf:62:69:17:9c -- Signature Algorithm: sha1WithRSAEncryption -- Issuer: C=JP, ST=Shimane, L=Matz-e city, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org -- Validity -- Not Before: Jan 3 01:34:17 2014 GMT -- Not After : Jan 2 01:34:17 2019 GMT -- Subject: C=JP, ST=Shimane, L=Matz-e city, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org -- Subject Public Key Info: -- Public Key Algorithm: rsaEncryption -- RSA Public Key: (1024 bit) -- Modulus (1024 bit): -- 00:db:75:d0:45:de:b1:df:bf:71:a0:0e:b0:a5:e6: -- bc:f4:1c:9d:e5:25:67:64:c5:7b:cb:f1:af:c6:be: -- 9a:aa:ea:7e:0f:cc:05:af:ef:40:69:06:b2:c9:13: -- 9d:7e:eb:a2:06:e2:ea:7d:07:c7:c7:99:c7:fb:d5: -- b8:eb:63:77:62:2b:18:12:c3:53:58:d0:f5:c7:40: -- 0c:01:d1:26:82:34:16:09:e3:dc:65:f4:dc:bb:5d: -- a5:41:60:e7:a9:74:ba:d7:4c:b6:a3:9c:c5:8c:89: -- af:cb:e8:9f:05:fe:ea:fe:64:24:bf:e7:ed:e3:f6: -- d0:fc:d6:eb:fc:06:82:10:fb -- Exponent: 65537 (0x10001) -- X509v3 extensions: -- X509v3 Subject Key Identifier: -- E8:7E:58:AC:13:7B:03:22:8D:9E:AF:32:0B:84:89:80:80:0C:1E:C2 -- X509v3 Authority Key Identifier: -- keyid:E8:7E:58:AC:13:7B:03:22:8D:9E:AF:32:0B:84:89:80:80:0C:1E:C2 -- DirName:/C=JP/ST=Shimane/L=Matz-e city/O=Ruby Core Team/CN=Ruby Test CA/emailAddress=security@ruby-lang.org -- serial:B9:90:A2:BF:62:69:17:9C -- -- X509v3 Basic Constraints: -- CA:TRUE -- Signature Algorithm: sha1WithRSAEncryption -- 8f:77:06:4e:31:72:12:ee:68:09:70:27:d4:31:85:ef:10:95: -- f9:0f:2b:66:63:08:37:88:6e:b7:9b:40:3e:18:77:33:86:e8: -- 61:6a:b7:3c:cb:c7:a6:d6:d5:92:6a:1f:56:d0:9f:5c:32:56: -- d3:37:52:fe:0e:20:c2:7a:0d:fe:2d:3c:81:da:b8:7f:4d:6a: -- 08:01:d9:be:7a:a2:15:be:a6:ce:49:64:90:8c:9a:ca:6e:2e: -- 84:48:1d:94:19:56:94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yk8VK6L -+2LG4WgGqyeePiRyd1o1MbuiAFYqAwpXNUbRKg5NaZGwBHZk8UZ+uFKt1QMBURO5R -+WFy1c349jbWszTqFyL4Lnbg9HhAowQIDAQABo1AwTjAdBgNVHQ4EFgQU9tEiKdU9 -+I9derQyc5nWPnc34nVMwHwYDVR0jBBgwFoAU9tEiKdU9I9derQyc5nWPnc34nVMw -+DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAxj7F/u3C3fgq24N7hGRA -+of7ClFQxGmo/IGT0AISzW3HiVYiFaikKhbO1NwD9aBpD8Zwe62sCqMh8jGV/b0+q -+aOORnWYNy2R6r9FkASAglmdF6xn3bhgGD5ls4pCvcG9FynGnGc24g6MrjFNrBYUS -+2iIZsg36i0IJswo/Dy6HLphCms2BMCD3DeWtfjePUiTmQHJo6HsQIKP/u4N4Fvee -+uMBInei2M4VU74fLXbmKl1F9AEX7JDP3BKSZG19Ch5pnUo4uXM1uNTGsi07P4Y0s -+K44+SKBC0bYEFbDK0eQWMrX3kIhkPxyIWhxdq9/NqPYjShuSEAhA6CSpmRg0pqc+ -+mA== - -----END CERTIFICATE----- -diff --git a/test/net/fixtures/server.crt b/test/net/fixtures/server.crt -index fa4f99493a..817ecc222c 100644 ---- a/test/net/fixtures/server.crt -+++ b/test/net/fixtures/server.crt -@@ -1,48 +1,83 @@ - Certificate: - Data: -- Version: 1 (0x0) -- Serial Number: 0 (0x0) -- Signature Algorithm: sha1WithRSAEncryption -+ Version: 3 (0x2) -+ Serial Number: 1 (0x1) -+ Signature Algorithm: sha256WithRSAEncryption - Issuer: C=JP, ST=Shimane, L=Matz-e city, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org - Validity -- Not Before: Jan 3 01:34:17 2014 GMT -- Not After : Jan 2 01:34:17 2019 GMT -- Subject: C=JP, ST=Shimane, O=Ruby Core Team, OU=Ruby Test, CN=localhost -+ Not Before: Jan 2 03:06:53 2019 GMT -+ Not After : Jan 1 03:06:53 2024 GMT -+ Subject: C=JP, ST=Shimane, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org - Subject Public Key Info: - Public Key Algorithm: rsaEncryption -- RSA Public Key: (1024 bit) -- Modulus (1024 bit): -- 00:db:75:d0:45:de:b1:df:bf:71:a0:0e:b0:a5:e6: -- bc:f4:1c:9d:e5:25:67:64:c5:7b:cb:f1:af:c6:be: -- 9a:aa:ea:7e:0f:cc:05:af:ef:40:69:06:b2:c9:13: -- 9d:7e:eb:a2:06:e2:ea:7d:07:c7:c7:99:c7:fb:d5: -- b8:eb:63:77:62:2b:18:12:c3:53:58:d0:f5:c7:40: -- 0c:01:d1:26:82:34:16:09:e3:dc:65:f4:dc:bb:5d: -- a5:41:60:e7:a9:74:ba:d7:4c:b6:a3:9c:c5:8c:89: -- af:cb:e8:9f:05:fe:ea:fe:64:24:bf:e7:ed:e3:f6: -- d0:fc:d6:eb:fc:06:82:10:fb -+ Public-Key: (2048 bit) -+ Modulus: -+ 00:c1:a9:64:ef:d3:f2:e1:1a:7f:24:df:7f:65:86: -+ c1:98:55:16:83:91:16:5b:63:6e:26:bb:c0:73:68: -+ 7b:f7:00:ba:37:db:7f:a9:5c:c8:98:aa:43:96:87: -+ e1:a0:63:69:0c:d8:22:90:f5:56:22:b1:57:6e:71: -+ 3b:30:04:d0:64:4d:38:33:a0:ea:c1:16:3d:16:be: -+ c0:49:4c:f0:14:15:af:09:95:da:bf:c7:23:34:c3: -+ 7d:af:b7:70:b3:6d:1b:de:21:93:c0:7c:6c:0e:fd: -+ 0e:e5:ff:f3:80:51:0c:df:80:7c:40:46:c9:ca:57: -+ d4:88:02:0f:f0:1e:14:18:f1:98:0f:c6:42:1d:cc: -+ 90:29:71:1b:af:4a:22:e0:e7:86:fc:dd:d3:d8:84: -+ 0e:5e:f0:9b:93:5f:0a:9a:1d:f8:f5:f3:e7:c7:b0: -+ 7a:0e:25:20:13:02:1a:22:c2:d9:e0:7f:4f:a1:7f: -+ 72:f6:e6:e1:14:7c:c5:93:7f:a6:96:3b:ab:d8:f1: -+ dc:2b:01:d6:e5:fe:5c:cf:08:db:06:e9:fd:7d:bd: -+ fe:2c:f4:8a:7b:9f:15:88:05:2e:f7:ba:c9:86:7e: -+ 14:50:f4:96:a1:84:17:5d:f7:8b:0a:7a:14:2c:de: -+ ca:00:74:f8:23:32:9d:66:af:1c:a6:58:1a:de:82: -+ 96:a9 - Exponent: 65537 (0x10001) -- Signature Algorithm: sha1WithRSAEncryption -- 85:f5:d3:05:8b:8c:f4:43:1c:88:f2:8f:b2:f2:93:77:b7:3d: -- 95:c6:a0:34:bc:33:6a:d8:85:5f:3e:86:08:10:c5:5c:c1:76: -- a3:53:3c:dc:38:98:23:97:e7:da:21:ac:e8:4d:3c:96:70:29: -- ff:ff:1e:4a:9a:17:2b:db:04:62:b9:ef:ab:ea:a7:a5:e8:7c: -- b1:d5:ed:30:a8:6c:78:de:51:7e:e3:8a:c2:a4:64:a8:63:a2: -- bc:fd:43:9c:f3:55:7d:54:c9:6a:d8:53:1c:4b:6b:03:aa:b6: -- 19:e6:a4:4f:47:00:96:c5:42:59:85:4e:c3:4e:cd:41:82:53: -- 10:f8 -+ X509v3 extensions: -+ X509v3 Basic Constraints: -+ CA:FALSE -+ Netscape Comment: -+ OpenSSL Generated Certificate -+ X509v3 Subject Key Identifier: -+ F2:C9:35:05:31:EF:08:EE:EF:B0:FE:1A:72:C2:9E:70:E3:E3:EC:43 -+ X509v3 Authority Key Identifier: -+ keyid:F6:D1:22:29:D5:3D:23:D7:5E:AD:0C:9C:E6:75:8F:9D:CD:F8:9D:53 -+ -+ Signature Algorithm: sha256WithRSAEncryption -+ 02:e7:0a:22:7c:5e:d9:92:d2:b9:fb:4a:bf:75:3f:00:e6:19: -+ 3e:90:a5:9d:38:41:82:4c:6f:b9:f3:f2:58:a1:91:7f:4a:d4: -+ 28:38:9c:7c:4d:6c:2f:2f:95:f5:55:55:25:a1:71:0c:05:42: -+ 08:a3:a6:ab:e3:04:47:9a:42:24:8f:b2:ba:50:55:af:b8:d7: -+ fc:1a:13:92:5d:75:7d:e1:4d:87:5e:57:82:c5:5f:d6:b8:ea: -+ 86:4e:05:b0:7f:07:27:a5:36:1f:1e:54:f1:32:35:7f:9c:75: -+ 26:6a:21:75:37:32:bb:89:01:78:97:cc:d3:de:3a:e8:ce:45: -+ ed:12:24:2e:a8:25:73:b3:cd:70:47:b8:81:f9:06:aa:8d:87: -+ 2f:a9:cd:fe:79:40:cc:c9:47:3d:2f:82:c2:82:bf:5d:8a:06: -+ 5b:a9:90:d3:b0:a7:fc:f3:1a:fb:0e:cb:8f:d8:f2:4e:f4:8d: -+ bb:4b:d5:2d:20:c0:6e:d5:08:2b:81:32:c4:e0:d2:4b:31:27: -+ f1:55:96:0e:d4:b9:92:02:71:98:69:e5:73:cc:52:45:a0:07: -+ fb:28:9e:b0:fc:b1:58:42:5a:08:4a:30:49:e5:f1:a5:c8:d5: -+ 8a:67:f0:ed:9e:3f:1b:71:a6:80:91:81:cb:1a:3d:b5:8e:87: -+ 9d:64:28:ce - -----BEGIN CERTIFICATE----- --MIICXDCCAcUCAQAwDQYJKoZIhvcNAQEFBQAwgYwxCzAJBgNVBAYTAkpQMRAwDgYD --VQQIEwdTaGltYW5lMRQwEgYDVQQHEwtNYXR6LWUgY2l0eTEXMBUGA1UEChMOUnVi --eSBDb3JlIFRlYW0xFTATBgNVBAMTDFJ1YnkgVGVzdCBDQTElMCMGCSqGSIb3DQEJ --ARYWc2VjdXJpdHlAcnVieS1sYW5nLm9yZzAeFw0xNDAxMDMwMTM0MTdaFw0xOTAx --MDIwMTM0MTdaMGAxCzAJBgNVBAYTAkpQMRAwDgYDVQQIEwdTaGltYW5lMRcwFQYD --VQQKEw5SdWJ5IENvcmUgVGVhbTESMBAGA1UECxMJUnVieSBUZXN0MRIwEAYDVQQD --Ewlsb2NhbGhvc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANt10EXesd+/ --caAOsK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8JuTXwqaHfj18+fHsHoOJSAT -+Ahoiwtngf0+hf3L25uEUfMWTf6aWO6vY8dwrAdbl/lzPCNsG6f19vf4s9Ip7nxWI -+BS73usmGfhRQ9JahhBdd94sKehQs3soAdPgjMp1mrxymWBregpapAgMBAAGjezB5 -+MAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENl -+cnRpZmljYXRlMB0GA1UdDgQWBBTyyTUFMe8I7u+w/hpywp5w4+PsQzAfBgNVHSME -+GDAWgBT20SIp1T0j116tDJzmdY+dzfidUzANBgkqhkiG9w0BAQsFAAOCAQEAAucK -+Inxe2ZLSuftKv3U/AOYZPpClnThBgkxvufPyWKGRf0rUKDicfE1sLy+V9VVVJaFx -+DAVCCKOmq+MER5pCJI+yulBVr7jX/BoTkl11feFNh15XgsVf1rjqhk4FsH8HJ6U2 -+Hx5U8TI1f5x1JmohdTcyu4kBeJfM09466M5F7RIkLqglc7PNcEe4gfkGqo2HL6nN -+/nlAzMlHPS+CwoK/XYoGW6mQ07Cn/PMa+w7Lj9jyTvSNu0vVLSDAbtUIK4EyxODS -+SzEn8VWWDtS5kgJxmGnlc8xSRaAH+yiesPyxWEJaCEowSeXxpcjVimfw7Z4/G3Gm -+gJGByxo9tY6HnWQozg== - -----END CERTIFICATE----- -diff --git a/test/net/fixtures/server.key b/test/net/fixtures/server.key -index 7c57546ece..1e73232728 100644 ---- a/test/net/fixtures/server.key -+++ b/test/net/fixtures/server.key -@@ -1,15 +1,28 @@ -------BEGIN RSA PRIVATE KEY----- --MIICXQIBAAKBgQDbddBF3rHfv3GgDrCl5rz0HJ3lJWdkxXvL8a/Gvpqq6n4PzAWv --70BpBrLJE51+66IG4up9B8fHmcf71bjrY3diKxgSw1NY0PXHQAwB0SaCNBYJ49xl --9Ny7XaVBYOepdLrXTLajnMWMia/L6J8F/ur+ZCS/5+3j9tD81uv8BoIQ+wIDAQAB --AoGAGtYHR+P5gFDaxiXFuCPFC1zMeg7e29XCU6gURIteQnQ2QhxCvcbV64HkLu51 --HeYWhB0Pa4aeCWxmpgb2e+JH4MEoIjeJSGyZQeqwkQLgWJDdvkgWx5am58QzA60I --ipkZ9QHcPffSs5RiGx4yfr58KqAmwFphGCY8W7v4LqaENdECQQD9H5VTW9g4gj1c --j3uNYvSI/D7a9P7gfI+ziczuwMm5xsBx3D/t5TAr3SJKNne3sl1E6ZERCUbzxf+C --k58EiHx1AkEA3fRLGqDOq7EcQhbjTcA/v/t5MwlGEUsS9+XrqOWn50YuoIwRZJ3v --qHRQzfQfFNklGtfBvwQ4md3irXjMeGVprwJBAMEAuwiDiHuV+xm/ofKtmE13IKot --ksYy1BOOp/8IawhHXueyi+BmF/PqOkIiA+jCjNGF0oIN89beizPSQbbgJx0CQG/K --qL1bu1ys0y/SeWBi8XkP/0aeaCUzq/UiYCTsrzoEll2UzvnftqMhGsXxLGqCyHaR --r2s3hA6zvIVlL4+AfM8CQQClq+WDrC5VKciLYakZNWJjV1m+H2Ut/0fXdUjKHajE --FWLcsrOhADf6bkTb71GwPxnKRkkRmud5upP0ZYYTqM4X -------END RSA PRIVATE KEY----- -+-----BEGIN PRIVATE KEY----- -+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDBqWTv0/LhGn8k -+339lhsGYVRaDkRZbY24mu8BzaHv3ALo323+pXMiYqkOWh+GgY2kM2CKQ9VYisVdu -+cTswBNBkTTgzoOrBFj0WvsBJTPAUFa8Jldq/xyM0w32vt3CzbRveIZPAfGwO/Q7l -+//OAUQzfgHxARsnKV9SIAg/wHhQY8ZgPxkIdzJApcRuvSiLg54b83dPYhA5e8JuT -+XwqaHfj18+fHsHoOJSATAhoiwtngf0+hf3L25uEUfMWTf6aWO6vY8dwrAdbl/lzP -+CNsG6f19vf4s9Ip7nxWIBS73usmGfhRQ9JahhBdd94sKehQs3soAdPgjMp1mrxym -+WBregpapAgMBAAECggEAYQJ20oBMcSBxwknGqlfnkGRHI97A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 -+XG6VvPpgVjMiDQCsTEEcBqgRRuf6R5zndIhIvwmTNiUkGkE3w/vG0uCjtB82/kwE -+bzVheR0vZDN7s52OYRz4j0ddtYCqGSkvkWuEQfQFZUDTyLodwVQAT5aR+mcr4Qml -+uCiVeqoPl+JIg4m8Tz76XWo= -+-----END PRIVATE KEY----- --- -2.20.1 - - -From 1e0b49a293d3792826c67b7e05c5fcbd09c9ea6e Mon Sep 17 00:00:00 2001 -From: kazu -Date: Wed, 2 Jan 2019 03:29:01 +0000 -Subject: [PATCH 2/2] Try to update cert (2nd try) - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - test/net/fixtures/server.crt | 115 +++++++++++++++++------------------ - test/net/fixtures/server.key | 52 ++++++++-------- - 2 files changed, 83 insertions(+), 84 deletions(-) - -diff --git a/test/net/fixtures/server.crt b/test/net/fixtures/server.crt -index 817ecc222c..5ca78a6d14 100644 ---- a/test/net/fixtures/server.crt -+++ b/test/net/fixtures/server.crt -@@ -1,35 +1,35 @@ - Certificate: - Data: - Version: 3 (0x2) -- Serial Number: 1 (0x1) -+ Serial Number: 2 (0x2) - Signature Algorithm: sha256WithRSAEncryption - Issuer: C=JP, ST=Shimane, L=Matz-e city, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org - Validity -- Not Before: Jan 2 03:06:53 2019 GMT -- Not After : Jan 1 03:06:53 2024 GMT -- Subject: C=JP, ST=Shimane, O=Ruby Core Team, CN=Ruby Test CA/emailAddress=security@ruby-lang.org -+ Not Before: Jan 2 03:27:13 2019 GMT -+ Not After : Jan 1 03:27:13 2024 GMT -+ Subject: C=JP, ST=Shimane, O=Ruby Core Team, OU=Ruby Test, CN=localhost - Subject Public Key Info: - Public Key Algorithm: rsaEncryption - Public-Key: (2048 bit) - Modulus: -- 00:c1:a9:64:ef:d3:f2:e1:1a:7f:24:df:7f:65:86: -- c1:98:55:16:83:91:16:5b:63:6e:26:bb:c0:73:68: -- 7b:f7:00:ba:37:db:7f:a9:5c:c8:98:aa:43:96:87: -- e1:a0:63:69:0c:d8:22:90:f5:56:22:b1:57:6e:71: -- 3b:30:04:d0:64:4d:38:33:a0:ea:c1:16:3d:16:be: -- c0:49:4c:f0:14:15:af:09:95:da:bf:c7:23:34:c3: -- 7d:af:b7:70:b3:6d:1b:de:21:93:c0:7c:6c:0e:fd: -- 0e:e5:ff:f3:80:51:0c:df:80:7c:40:46:c9:ca:57: -- d4:88:02:0f:f0:1e:14:18:f1:98:0f:c6:42:1d:cc: -- 90:29:71:1b:af:4a:22:e0:e7:86:fc:dd:d3:d8:84: -- 0e:5e:f0:9b:93:5f:0a:9a:1d:f8:f5:f3:e7:c7:b0: -- 7a:0e:25:20:13:02:1a:22:c2:d9:e0:7f:4f:a1:7f: -- 72:f6:e6:e1:14:7c:c5:93:7f:a6:96:3b:ab:d8:f1: -- dc:2b:01:d6:e5:fe:5c:cf:08:db:06:e9:fd:7d:bd: -- fe:2c:f4:8a:7b:9f:15:88:05:2e:f7:ba:c9:86:7e: -- 14:50:f4:96:a1:84:17:5d:f7:8b:0a:7a:14:2c:de: -- ca:00:74:f8:23:32:9d:66:af:1c:a6:58:1a:de:82: -- 96:a9 -+ 00:e8:da:9c:01:2e:2b:10:ec:49:cd:5e:07:13:07: -+ 9c:70:9e:c6:74:bc:13:c2:e1:6f:c6:82:fd:e3:48: -+ e0:2c:a5:68:c7:9e:42:de:60:54:65:e6:6a:14:57: -+ 7a:30:d0:cc:b5:b6:d9:c3:d2:df:c9:25:97:54:67: -+ cf:f6:be:5e:cb:8b:ee:03:c5:e1:e2:f9:e7:f7:d1: -+ 0c:47:f0:b8:da:33:5a:ad:41:ad:e7:b5:a2:7b:b7: -+ bf:30:da:60:f8:e3:54:a2:bc:3a:fd:1b:74:d9:dc: -+ 74:42:e9:29:be:df:ac:b4:4f:eb:32:f4:06:f1:e1: -+ 8c:4b:a8:8b:fb:29:e7:b1:bf:1d:01:ee:73:0f:f9: -+ 40:dc:d5:15:79:d9:c6:73:d0:c0:dd:cb:e4:da:19: -+ 47:80:c6:14:04:72:fd:9a:7c:8f:11:82:76:49:04: -+ 79:cc:f2:5c:31:22:95:13:3e:5d:40:a6:4d:e0:a3: -+ 02:26:7d:52:3b:bb:ed:65:a1:0f:ed:6b:b0:3c:d4: -+ de:61:15:5e:d3:dd:68:09:9f:4a:57:a5:c2:a9:6d: -+ 86:92:c5:f4:a4:d4:b7:13:3b:52:63:24:05:e2:cc: -+ e3:8a:3c:d4:35:34:2b:10:bb:58:72:e7:e1:8d:1d: -+ 74:8c:61:16:20:3d:d0:1c:4e:8f:6e:fd:fe:64:10: -+ 4f:41 - Exponent: 65537 (0x10001) - X509v3 extensions: - X509v3 Basic Constraints: -@@ -37,47 +37,46 @@ Certificate: - Netscape Comment: - OpenSSL Generated Certificate - X509v3 Subject Key Identifier: -- F2:C9:35:05:31:EF:08:EE:EF:B0:FE:1A:72:C2:9E:70:E3:E3:EC:43 -+ ED:28:C2:7E:AB:4B:C8:E8:FE:55:6D:66:95:31:1C:2D:60:F9:02:36 - X509v3 Authority Key Identifier: - keyid:F6:D1:22:29:D5:3D:23:D7:5E:AD:0C:9C:E6:75:8F:9D:CD:F8:9D:53 - - Signature Algorithm: sha256WithRSAEncryption -- 02:e7:0a:22:7c:5e:d9:92:d2:b9:fb:4a:bf:75:3f:00:e6:19: -- 3e:90:a5:9d:38:41:82:4c:6f:b9:f3:f2:58:a1:91:7f:4a:d4: -- 28:38:9c:7c:4d:6c:2f:2f:95:f5:55:55:25:a1:71:0c:05:42: -- 08:a3:a6:ab:e3:04:47:9a:42:24:8f:b2:ba:50:55:af:b8:d7: -- fc:1a:13:92:5d:75:7d:e1:4d:87:5e:57:82:c5:5f:d6:b8:ea: -- 86:4e:05:b0:7f:07:27:a5:36:1f:1e:54:f1:32:35:7f:9c:75: -- 26:6a:21:75:37:32:bb:89:01:78:97:cc:d3:de:3a:e8:ce:45: -- ed:12:24:2e:a8:25:73:b3:cd:70:47:b8:81:f9:06:aa:8d:87: -- 2f:a9:cd:fe:79:40:cc:c9:47:3d:2f:82:c2:82:bf:5d:8a:06: -- 5b:a9:90:d3:b0:a7:fc:f3:1a:fb:0e:cb:8f:d8:f2:4e:f4:8d: -- bb:4b:d5:2d:20:c0:6e:d5:08:2b:81:32:c4:e0:d2:4b:31:27: -- f1:55:96:0e:d4:b9:92:02:71:98:69:e5:73:cc:52:45:a0:07: -- fb:28:9e:b0:fc:b1:58:42:5a:08:4a:30:49:e5:f1:a5:c8:d5: -- 8a:67:f0:ed:9e:3f:1b:71:a6:80:91:81:cb:1a:3d:b5:8e:87: -- 9d:64:28:ce -+ 1d:b8:c5:8b:72:41:20:65:ad:27:6f:15:63:06:26:12:8d:9c: -+ ad:ca:f4:db:97:b4:90:cb:ff:35:94:bb:2a:a7:a1:ab:1e:35: -+ 2d:a5:3f:c9:24:b0:1a:58:89:75:3e:81:0a:2c:4f:98:f9:51: -+ fb:c0:a3:09:d0:0a:9b:e7:a2:b7:c3:60:40:c8:f4:6d:b2:6a: -+ 56:12:17:4c:00:24:31:df:9c:60:ae:b1:68:54:a9:e6:b5:4a: -+ 04:e6:92:05:86:d9:5a:dc:96:30:a5:58:de:14:99:0f:e5:15: -+ 89:3e:9b:eb:80:e3:bd:83:c3:ea:33:35:4b:3e:2f:d3:0d:64: -+ 93:67:7f:8d:f5:3f:0c:27:bc:37:5a:cc:d6:47:16:af:5a:62: -+ d2:da:51:f8:74:06:6b:24:ad:28:68:08:98:37:7d:ed:0e:ab: -+ 1e:82:61:05:d0:ba:75:a0:ab:21:b0:9a:fd:2b:54:86:1d:0d: -+ 1f:c2:d4:77:1f:72:26:5e:ad:8a:9f:09:36:6d:44:be:74:c2: -+ 5a:3e:ff:5c:9d:75:d6:38:7b:c5:39:f9:44:6e:a1:d1:8e:ff: -+ 63:db:c4:bb:c6:91:92:ca:5c:60:9b:1d:eb:0a:de:08:ee:bf: -+ da:76:03:65:62:29:8b:f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MHkwCQYDVR0TBAIwADAsBglghkgBhvhC -+AQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFO0o -+wn6rS8jo/lVtZpUxHC1g+QI2MB8GA1UdIwQYMBaAFPbRIinVPSPXXq0MnOZ1j53N -++J1TMA0GCSqGSIb3DQEBCwUAA4IBAQAduMWLckEgZa0nbxVjBiYSjZytyvTbl7SQ -+y/81lLsqp6GrHjUtpT/JJLAaWIl1PoEKLE+Y+VH7wKMJ0Aqb56K3w2BAyPRtsmpW -+EhdMACQx35xgrrFoVKnmtUoE5pIFhtla3JYwpVjeFJkP5RWJPpvrgOO9g8PqMzVL -+Pi/TDWSTZ3+N9T8MJ7w3WszWRxavWmLS2lH4dAZrJK0oaAiYN33tDqsegmEF0Lp1 -+oKshsJr9K1SGHQ0fwtR3H3ImXq2Knwk2bUS+dMJaPv9cnXXWOHvFOflEbqHRjv9j -+28S7xpGSylxgmx3rCt4I7r/adgNlYimL+H/HhnMe9h8tiWn9vr1u - -----END CERTIFICATE----- -diff --git a/test/net/fixtures/server.key b/test/net/fixtures/server.key -index 1e73232728..7f2380e71e 100644 ---- a/test/net/fixtures/server.key -+++ b/test/net/fixtures/server.key -@@ -1,28 +1,28 @@ - -----BEGIN PRIVATE KEY----- --MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDBqWTv0/LhGn8k --339lhsGYVRaDkRZbY24mu8BzaHv3ALo323+pXMiYqkOWh+GgY2kM2CKQ9VYisVdu --cTswBNBkTTgzoOrBFj0WvsBJTPAUFa8Jldq/xyM0w32vt3CzbRveIZPAfGwO/Q7l --//OAUQzfgHxARsnKV9SIAg/wHhQY8ZgPxkIdzJApcRuvSiLg54b83dPYhA5e8JuT --XwqaHfj18+fHsHoOJSATAhoiwtngf0+hf3L25uEUfMWTf6aWO6vY8dwrAdbl/lzP --CNsG6f19vf4s9Ip7nxWIBS73usmGfhRQ9JahhBdd94sKehQ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C3Q7FK4VIGHK7B0zNvZr5tEjlFfeRezo2JMVw5YWeSagIFcSwK+KqCTH9qc -+pw/Eb8nB/4XNcpTZu7Fg0Wc+ooUCgYEA8sVaicn1Wxkpb45a4qfrA6wOr5xdJ4cC -+A5qs7vjX2OdPIQOmoQhdI7bCWFXZzF33wA4YCws6j5wRaySLIJqdms8Gl9QnODy1 -+ZlA5gwKToBC/jqPmWAXSKb8EH7cHilaxU9OKnQ7CfwlGLHqjMtjrhR7KHlt3CVRs -+oRmvsjZVXI0CgYAmPedslAO6mMhFSSfULrhMXmV82OCqYrrA6EEkVNGbcdnzAOkD -+gfKIWabDd8bFY10po4Mguy0CHzNhBXIioWQWV5BlbhC1YKMLw+S9DzSdLAKGY9gJ -+xQ4+UQ3wtRQ/k+IYR413RUsW2oFvgZ3KSyNeAb9MK6uuv84VdG/OzVSs/QKBgQDn -+kap//l2EbObiWyaERunckdVcW0lcN+KK75J/TGwPoOwQsLvTpPe65kxRGGrtDsEQ -+uCDk/+v3KkZPLgdrrTAih9FhJ+PVN8tMcb+6IM4SA4fFFr/UPJEwct0LJ3oQ0grJ -+y+HPWFHb/Uurh7t99/4H98uR02sjQh1wOeEmm78mzQKBgQDm+LzGH0se6CXQ6cdZ -+g1JRZeXkDEsrW3hfAsW62xJQmXcWxBoblP9OamMY+A06rM5og3JbDk5Zm6JsOaA8 -+wS2gw4ilp46jors4eQey8ux7kB9LzdBoDBBElnsbjLO8oBNZlVcYXg+6BOl/CUi7 -+2whRF0FEjKA8ehrNhAq+VFfFNw== - -----END PRIVATE KEY----- --- -2.20.1 - diff --git a/ruby-2.6.0-Update-for-tzdata-2018f.patch b/ruby-2.6.0-Update-for-tzdata-2018f.patch deleted file mode 100644 index edc58b6..0000000 --- a/ruby-2.6.0-Update-for-tzdata-2018f.patch +++ /dev/null @@ -1,44 +0,0 @@ -From e71ca6cdcf108e6a2fa47ec9fadefe7554717908 Mon Sep 17 00:00:00 2001 -From: nobu -Date: Fri, 26 Oct 2018 01:47:09 +0000 -Subject: [PATCH] Update for tzdata-2018f - -git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e ---- - test/ruby/test_time_tz.rb | 12 +++++++++--- - 1 file changed, 9 insertions(+), 3 deletions(-) - -diff --git a/test/ruby/test_time_tz.rb b/test/ruby/test_time_tz.rb -index 2da4fd8d9ce4..328fde48fc34 100644 ---- a/test/ruby/test_time_tz.rb -+++ b/test/ruby/test_time_tz.rb -@@ -86,7 +86,9 @@ def group_by(e, &block) - has_lisbon_tz &&= have_tz_offset?("Europe/Lisbon") - CORRECT_TOKYO_DST_1951 = with_tz("Asia/Tokyo") { - if Time.local(1951, 5, 6, 12, 0, 0).dst? # noon, DST -- Time.local(1951, 5, 6, 1, 0, 0).dst? # DST with fixed tzdata -+ if Time.local(1951, 5, 6, 1, 0, 0).dst? # DST with fixed tzdata -+ Time.local(1951, 9, 8, 23, 0, 0).dst? ? "2018f" : "2018e" -+ end - end - } - CORRECT_KIRITIMATI_SKIP_1994 = with_tz("Pacific/Kiritimati") { -@@ -347,12 +349,16 @@ def self.gen_zdump_test(data) - Asia/Singapore Thu Dec 31 16:29:59 1981 UTC = Thu Dec 31 23:59:59 1981 SGT isdst=0 gmtoff=27000 - Asia/Singapore Thu Dec 31 16:30:00 1981 UTC = Fri Jan 1 00:30:00 1982 SGT isdst=0 gmtoff=28800 - End -- gen_zdump_test CORRECT_TOKYO_DST_1951 ? <<'End' : <<'End' -+ gen_zdump_test CORRECT_TOKYO_DST_1951 ? <<'End' + (CORRECT_TOKYO_DST_1951 < "2018f" ? <<'2018e' : <<'2018f') : <<'End' - Asia/Tokyo Sat May 5 14:59:59 1951 UTC = Sat May 5 23:59:59 1951 JST isdst=0 gmtoff=32400 - Asia/Tokyo Sat May 5 15:00:00 1951 UTC = Sun May 6 01:00:00 1951 JDT isdst=1 gmtoff=36000 -+End - Asia/Tokyo Sat Sep 8 13:59:59 1951 UTC = Sat Sep 8 23:59:59 1951 JDT isdst=1 gmtoff=36000 - Asia/Tokyo Sat Sep 8 14:00:00 1951 UTC = Sat Sep 8 23:00:00 1951 JST isdst=0 gmtoff=32400 --End -+2018e -+Asia/Tokyo Sat Sep 8 14:59:59 1951 UTC = Sun Sep 9 00:59:59 1951 JDT isdst=1 gmtoff=36000 -+Asia/Tokyo Sat Sep 8 15:00:00 1951 UTC = Sun Sep 9 00:00:00 1951 JST isdst=0 gmtoff=32400 -+2018f - Asia/Tokyo Sat May 5 16:59:59 1951 UTC = Sun May 6 01:59:59 1951 JST isdst=0 gmtoff=32400 - Asia/Tokyo Sat May 5 17:00:00 1951 UTC = Sun May 6 03:00:00 1951 JDT isdst=1 gmtoff=36000 - Asia/Tokyo Fri Sep 7 15:59:59 1951 UTC = Sat Sep 8 01:59:59 1951 JDT isdst=1 gmtoff=36000 diff --git a/ruby.spec b/ruby.spec index 1cc9a85..072c65d 100644 --- a/ruby.spec +++ b/ruby.spec @@ -1,6 +1,6 @@ %global major_version 2 %global minor_version 5 -%global teeny_version 3 +%global teeny_version 5 %global major_minor_version %{major_version}.%{minor_version} %global ruby_version %{major_minor_version}.%{teeny_version} @@ -21,7 +21,7 @@ %endif -%global release 95 +%global release 101 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory tree, since the @@ -29,7 +29,7 @@ %global rubygems_dir %{_datadir}/rubygems # Bundled libraries versions -%global rubygems_version 2.7.6 +%global rubygems_version 2.7.6.2 %global molinillo_version 0.5.7 # TODO: The IRB has strange versioning. Keep the Ruby's versioning ATM. @@ -135,13 +135,6 @@ Patch9: ruby-2.3.1-Rely-on-ldd-to-detect-glibc.patch # Add Gem.operating_system_defaults to allow packagers to override defaults. # https://github.com/rubygems/rubygems/pull/2116 Patch10: ruby-2.5.0-Add-Gem.operating_system_defaults.patch -# Fix Tokyo TZ tests. -# https://github.com/ruby/ruby/commit/e71ca6cdcf108e6a2fa47ec9fadefe7554717908 -Patch25: ruby-2.6.0-Update-for-tzdata-2018f.patch -# Refresh expired certificates. -# https://bugs.ruby-lang.org/issues/15502 -# https://github.com/ruby/ruby/commit/6f9b40ea53d8f3fb2a5b1c7ac55c207d42c77ef4 -Patch11: ruby-2.6.0-Try-to-update-cert.patch Requires: %{name}-libs%{?_isa} = %{version}-%{release} Suggests: rubypick @@ -525,8 +518,6 @@ rm -rf ext/fiddle/libffi* %patch7 -p1 %patch9 -p1 %patch10 -p1 -%patch11 -p1 -%patch25 -p1 # Provide an example of usage of the tapset: cp -a %{SOURCE3} . @@ -1069,6 +1060,9 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog +* Thu Apr 04 2019 Pavel Valena - 2.5.5-101 +- Update to Ruby 2.5.5. + * Fri Jan 11 2019 Jun Aruga - 2.5.3-95 - Fix Tokyo TZ tests. - Refresh expired certificates to fix FTBFS. diff --git a/sources b/sources index 5927406..e2dbc39 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (ruby-2.5.3.tar.xz) = 6dcae0e8d0bacdb2cbde636e2030596308b5af53f2eb85d3adccb67b02e6f8f9751e8117d12f8484829fdd9d995f6e327f701d9b433bcf94f1f59d13a1fd7518 +SHA512 (ruby-2.5.5.tar.xz) = 06b1d58536ebfacb7b56c1e6ed4b8ab816fadc4f48c845a452554cd262e7908199a30e5793f3cbaec2db56a8803aa5c6089abf7bf06c8fc47867e97870b7dfec From ebbdf9b7a866e9f51d9cafb4ed2377ef1408d1f8 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Thu, 25 Apr 2019 12:35:36 +0200 Subject: [PATCH 20/21] Bump to avoid nvre collision with rubygem-power_assert --- ruby.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby.spec b/ruby.spec index 072c65d..a49c7d1 100644 --- a/ruby.spec +++ b/ruby.spec @@ -21,7 +21,7 @@ %endif -%global release 101 +%global release 102 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory tree, since the @@ -1060,7 +1060,7 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog -* Thu Apr 04 2019 Pavel Valena - 2.5.5-101 +* Thu Apr 04 2019 Pavel Valena - 2.5.5-102 - Update to Ruby 2.5.5. * Fri Jan 11 2019 Jun Aruga - 2.5.3-95 From 78a252290eaf17391dd1794299bfa4e625b4f0b4 Mon Sep 17 00:00:00 2001 From: Pavel Valena Date: Fri, 26 Apr 2019 15:08:14 +0200 Subject: [PATCH 21/21] Bump to avoid nvre collision with rubygem-json --- ruby.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruby.spec b/ruby.spec index a49c7d1..4d93517 100644 --- a/ruby.spec +++ b/ruby.spec @@ -21,7 +21,7 @@ %endif -%global release 102 +%global release 108 %{!?release_string:%global release_string %{?development_release:0.}%{release}%{?development_release:.%{development_release}}%{?dist}} # The RubyGems library has to stay out of Ruby directory tree, since the @@ -1060,7 +1060,7 @@ make check TESTS="-v $DISABLE_TESTS" %{gem_dir}/specifications/xmlrpc-%{xmlrpc_version}.gemspec %changelog -* Thu Apr 04 2019 Pavel Valena - 2.5.5-102 +* Thu Apr 04 2019 Pavel Valena - 2.5.5-108 - Update to Ruby 2.5.5. * Fri Jan 11 2019 Jun Aruga - 2.5.3-95