rubygems-update 1.8.25 → 1.8.26

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rubygems-update might be problematic. Click here for more details.

checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 96e012cc53e235e197d84c2d2a4eea42b89bc4e5
4
+ data.tar.gz: 6963749517681827506e11a24b0e7c1fb75ae347
5
+ SHA512:
6
+ metadata.gz: 09a61481c125c0740fc699d29b1ee5567bb3ef6e6b7c9622f546d496b09319fcaa12282b7056d1ee961cda99739f2849114b6d81fd550f5786baf842474a0a85
7
+ data.tar.gz: bdb3d9f8e46d4ba2270589f7085e844c59052485a990d557e506e57ad30132e196e05684cfaf3ee0c94bfbc9ca241e927048a9961236677b6d3f94bdefedbd01
checksums.yaml.gz.sig ADDED
@@ -0,0 +1 @@
1
+ M���#��������i1���,T,�-�^�k�Trwj�-
data.tar.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ X�$���>X�个��FZF���(7�����G
2
+ m���D�۰�`��~�V��T�=;G�Tv0*Y���~,���T�TH���i��N >2�p�5�W��6CR�G��znٷ-�4��4���ر ���D>��˝3i��48_!S��G��|�*����s�Ͱ�Lu
data/.autotest CHANGED
@@ -6,7 +6,7 @@ Gem.refresh
6
6
  require 'autotest/restart'
7
7
 
8
8
  Autotest.add_hook :initialize do |at|
9
- at.testlib = 'minitest/autorun'
9
+ at.testlib = ''
10
10
 
11
11
  at.add_exception %r%/\.git/%
12
12
  at.add_exception %r%/\.svn/%
data/CVE-2013-4287.txt ADDED
@@ -0,0 +1,36 @@
1
+ = Algorithmic complexity vulnerability in RubyGems 2.0.7 and older
2
+
3
+ RubyGems validates versions with a regular expression that is vulnerable to
4
+ denial of service due to a backtracking regular expression. For specially
5
+ crafted RubyGems versions attackers can cause denial of service through CPU
6
+ consumption.
7
+
8
+ RubyGems versions 2.0.7 and older, 2.1.0.rc.1 and 2.1.0.rc.2 are vulnerable.
9
+
10
+ Ruby versions 1.9.0 through 2.0.0p247 are vulnerable as they contain embedded
11
+ versions of RubyGems.
12
+
13
+ It does not appear to be possible to exploit this vulnerability by installing a
14
+ gem for RubyGems 1.8.x or 2.0.x. Vulnerable uses of RubyGems API include
15
+ packaging a gem (through `gem build`, Gem::Package or Gem::PackageTask),
16
+ sending user input to Gem::Version.new, Gem::Version.correct? or use of the
17
+ Gem::Version::VERSION_PATTERN or Gem::Version::ANCHORED_VERSION_PATTERN
18
+ constants.
19
+
20
+ Notably, users of bundler that install gems from git are vulnerable if a
21
+ malicious author changes the gemspec to an invalid version.
22
+
23
+ The vulnerability can be fixed by changing the first grouping to an atomic
24
+ grouping in Gem::Version::VERSION_PATTERN in lib/rubygems/version.rb. For
25
+ RubyGems 2.0.x:
26
+
27
+ - VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:
28
+ + VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:
29
+
30
+ For RubyGems 1.8.x:
31
+
32
+ - VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*' # :nodoc:
33
+ + VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*' # :nodoc:
34
+
35
+ This vulnerability was discovered by Damir Sharipov <dammer2k@gmail.com>
36
+
data/History.txt CHANGED
@@ -1,6 +1,19 @@
1
1
  # coding: UTF-8
2
2
 
3
- === 1.8.25/ 2013-01-24
3
+ === 1.8.26 / 2013-09-09
4
+
5
+ Security fixes:
6
+
7
+ * RubyGems 2.0.7 and earlier are vulnerable to excessive CPU usage due to a
8
+ backtracking in Gem::Version validation. See CVE-2013-4287 for full details
9
+ including vulnerable APIs. Fixed versions include 2.0.8, 1.8.26 and
10
+ 1.8.23.1 (for Ruby 1.9.3). Issue #626 by Damir Sharipov.
11
+
12
+ Bug fixes:
13
+
14
+ * Fixed editing of a Makefile with 8-bit characters. Fixes #181
15
+
16
+ === 1.8.25 / 2013-01-24
4
17
 
5
18
  * 6 bug fixes:
6
19
 
data/Manifest.txt CHANGED
@@ -1,5 +1,6 @@
1
1
  .autotest
2
2
  .document
3
+ CVE-2013-4287.txt
3
4
  History.txt
4
5
  LICENSE.txt
5
6
  MIT.txt
@@ -164,6 +165,7 @@ test/rubygems/test_gem_dependency.rb
164
165
  test/rubygems/test_gem_dependency_installer.rb
165
166
  test/rubygems/test_gem_dependency_list.rb
166
167
  test/rubygems/test_gem_doc_manager.rb
168
+ test/rubygems/test_gem_ext_builder.rb
167
169
  test/rubygems/test_gem_ext_configure_builder.rb
168
170
  test/rubygems/test_gem_ext_ext_conf_builder.rb
169
171
  test/rubygems/test_gem_ext_rake_builder.rb
data/Rakefile CHANGED
@@ -26,6 +26,9 @@ hoe = Hoe.spec 'rubygems-update' do
26
26
  self.email = %w[rubygems-developers@rubyforge.org]
27
27
  self.readme_file = 'README.rdoc'
28
28
 
29
+ license 'Ruby'
30
+ license 'MIT'
31
+
29
32
  spec_extras[:required_rubygems_version] = Gem::Requirement.default
30
33
  spec_extras[:required_ruby_version] = Gem::Requirement.new '>= 1.8.7'
31
34
  spec_extras[:executables] = ['update_rubygems']
@@ -50,7 +53,9 @@ hoe = Hoe.spec 'rubygems-update' do
50
53
  extra_dev_deps << ['rcov', '~> 0.9.0']
51
54
  extra_dev_deps << ['ZenTest', '~> 4.5']
52
55
 
53
- self.extra_rdoc_files = Dir["*.rdoc"]
56
+ self.extra_rdoc_files = Dir["*.rdoc"] + %w[
57
+ CVE-2013-4287.txt
58
+ ]
54
59
 
55
60
  spec_extras['rdoc_options'] = proc do |rdoc_options|
56
61
  rdoc_options << "--title=RubyGems #{self.version} Documentation"
@@ -65,6 +70,8 @@ hoe = Hoe.spec 'rubygems-update' do
65
70
  ENV['RAKE_SUCKS']
66
71
  end
67
72
 
73
+ hoe.test_prelude = 'gem "minitest", "~> 4.0"'
74
+
68
75
  task :docs => :rake_sucks
69
76
  task :rake_sucks do
70
77
  # This exists ENTIRELY because the rake design convention of
@@ -84,7 +91,7 @@ end
84
91
 
85
92
  task :prerelease => [:clobber, :check_manifest, :test]
86
93
 
87
- task :postrelease => [:publish_docs, :upload]
94
+ task :postrelease => [:upload, :publish_docs]
88
95
 
89
96
  pkg_dir_path = "pkg/rubygems-update-#{hoe.version}"
90
97
  task :package do
data/lib/rubygems.rb CHANGED
@@ -121,7 +121,7 @@ require "rubygems/deprecate"
121
121
  # -The RubyGems Team
122
122
 
123
123
  module Gem
124
- VERSION = '1.8.25'
124
+ VERSION = '1.8.26'
125
125
 
126
126
  ##
127
127
  # Raised when RubyGems is unable to load or activate a gem. Contains the
@@ -4,8 +4,18 @@
4
4
  # See LICENSE.txt for permissions.
5
5
  #++
6
6
 
7
+ require 'thread'
8
+
7
9
  class Gem::Ext::Builder
8
10
 
11
+ ##
12
+ # The builder shells-out to run various commands after changing the
13
+ # directory. This means multiple installations cannot be allowed to build
14
+ # extensions in parallel as they may change each other's directories leading
15
+ # to broken extensions or failed installations.
16
+
17
+ CHDIR_MUTEX = Mutex.new # :nodoc:
18
+
9
19
  def self.class_name
10
20
  name =~ /Ext::(.*)Builder/
11
21
  $1.downcase
@@ -16,12 +26,6 @@ class Gem::Ext::Builder
16
26
  raise Gem::InstallError, "Makefile not found:\n\n#{results.join "\n"}"
17
27
  end
18
28
 
19
- mf = File.read('Makefile')
20
- mf = mf.gsub(/^RUBYARCHDIR\s*=\s*\$[^$]*/, "RUBYARCHDIR = #{dest_path}")
21
- mf = mf.gsub(/^RUBYLIBDIR\s*=\s*\$[^$]*/, "RUBYLIBDIR = #{dest_path}")
22
-
23
- File.open('Makefile', 'wb') {|f| f.print mf}
24
-
25
29
  # try to find make program from Ruby configure arguments first
26
30
  RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/
27
31
  make_program = $1 || ENV['make']
@@ -29,13 +33,16 @@ class Gem::Ext::Builder
29
33
  make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
30
34
  end
31
35
 
32
- ['', ' install'].each do |target|
33
- cmd = "#{make_program}#{target}"
34
- results << cmd
35
- results << `#{cmd} #{redirector}`
36
+ destdir = '"DESTDIR=%s"' % ENV['DESTDIR'] if RUBY_VERSION > '2.0'
36
37
 
37
- raise Gem::InstallError, "make#{target} failed:\n\n#{results}" unless
38
- $?.success?
38
+ ['', 'install'].each do |target|
39
+ # Pass DESTDIR via command line to override what's in MAKEFLAGS
40
+ cmd = [
41
+ make_program,
42
+ destdir,
43
+ target
44
+ ].join(' ').rstrip
45
+ run(cmd, results, "make #{target}".rstrip)
39
46
  end
40
47
  end
41
48
 
@@ -43,12 +50,12 @@ class Gem::Ext::Builder
43
50
  '2>&1'
44
51
  end
45
52
 
46
- def self.run(command, results)
53
+ def self.run(command, results, command_name = nil)
47
54
  results << command
48
55
  results << `#{command} #{redirector}`
49
56
 
50
57
  unless $?.success? then
51
- raise Gem::InstallError, "#{class_name} failed:\n\n#{results.join "\n"}"
58
+ raise Gem::InstallError, "#{command_name || class_name} failed:\n\n#{results.join "\n"}"
52
59
  end
53
60
  end
54
61
 
@@ -6,18 +6,58 @@
6
6
 
7
7
  require 'rubygems/ext/builder'
8
8
  require 'rubygems/command'
9
+ require 'fileutils'
10
+ require 'tempfile'
9
11
 
10
12
  class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
13
+ FileEntry = FileUtils::Entry_ # :nodoc:
11
14
 
12
15
  def self.build(extension, directory, dest_path, results)
13
- cmd = "#{Gem.ruby} #{File.basename extension}"
14
- cmd << " #{Gem::Command.build_args.join ' '}" unless Gem::Command.build_args.empty?
16
+ tmp_dest = Dir.mktmpdir(".gem.", ".")
15
17
 
16
- run cmd, results
18
+ t = nil
19
+ Tempfile.open %w"siteconf .rb", "." do |siteconf|
20
+ t = siteconf
21
+ siteconf.puts "require 'rbconfig'"
22
+ siteconf.puts "dest_path = #{(tmp_dest || dest_path).dump}"
23
+ %w[sitearchdir sitelibdir].each do |dir|
24
+ siteconf.puts "RbConfig::MAKEFILE_CONFIG['#{dir}'] = dest_path"
25
+ siteconf.puts "RbConfig::CONFIG['#{dir}'] = dest_path"
26
+ end
17
27
 
18
- make dest_path, results
28
+ siteconf.flush
29
+
30
+ rubyopt = ENV["RUBYOPT"]
31
+ destdir = ENV["DESTDIR"]
32
+
33
+ begin
34
+ ENV["RUBYOPT"] = ["-r#{siteconf.path}", rubyopt].compact.join(' ')
35
+ cmd = [Gem.ruby, File.basename(extension), *Gem::Command.build_args].join ' '
36
+
37
+ run cmd, results
38
+
39
+ ENV["DESTDIR"] = nil
40
+ ENV["RUBYOPT"] = rubyopt
41
+ siteconf.unlink
42
+
43
+ make dest_path, results
44
+
45
+ if tmp_dest
46
+ FileEntry.new(tmp_dest).traverse do |ent|
47
+ destent = ent.class.new(dest_path, ent.rel)
48
+ destent.exist? or File.rename(ent.path, destent.path)
49
+ end
50
+ end
51
+ ensure
52
+ ENV["RUBYOPT"] = rubyopt
53
+ ENV["DESTDIR"] = destdir
54
+ end
55
+ end
56
+ t.unlink if t and t.path
19
57
 
20
58
  results
59
+ ensure
60
+ FileUtils.rm_rf tmp_dest if tmp_dest
21
61
  end
22
62
 
23
63
  end
@@ -538,10 +538,12 @@ TEXT
538
538
 
539
539
 
540
540
  begin
541
- Dir.chdir extension_dir do
542
- results = builder.build(extension, gem_dir, dest_path, results)
541
+ Gem::Ext::Builder::CHDIR_MUTEX.synchronize do
542
+ Dir.chdir extension_dir do
543
+ results = builder.build(extension, gem_dir, dest_path, results)
543
544
 
544
- say results.join("\n") if Gem.configuration.really_verbose
545
+ say results.join("\n") if Gem.configuration.really_verbose
546
+ end
545
547
  end
546
548
  rescue
547
549
  results = results.join "\n"
@@ -1,5 +1,7 @@
1
1
  at_exit { $SAFE = 1 }
2
2
 
3
+ gem 'minitest', '~> 4.0'
4
+
3
5
  if defined? Gem::QuickLoader
4
6
  Gem::QuickLoader.load_full_rubygems_library
5
7
  else
@@ -21,6 +23,7 @@ require 'rubygems/test_utilities'
21
23
  require 'pp'
22
24
  require 'zlib'
23
25
  require 'pathname'
26
+ require 'shellwords'
24
27
  Gem.load_yaml
25
28
 
26
29
  require 'rubygems/mock_gem_ui'
@@ -92,6 +95,63 @@ class Gem::TestCase < MiniTest::Unit::TestCase
92
95
  refute File.exist?(path), msg
93
96
  end
94
97
 
98
+ def scan_make_command_lines(output)
99
+ output.scan(/^#{Regexp.escape make_command}(?:[[:blank:]].*)?$/)
100
+ end
101
+
102
+ def parse_make_command_line(line)
103
+ command, *args = line.shellsplit
104
+
105
+ targets = []
106
+ macros = {}
107
+
108
+ args.each do |arg|
109
+ case arg
110
+ when /\A(\w+)=/
111
+ macros[$1] = $'
112
+ else
113
+ targets << arg
114
+ end
115
+ end
116
+
117
+ targets << '' if targets.empty?
118
+
119
+ {
120
+ :command => command,
121
+ :targets => targets,
122
+ :macros => macros,
123
+ }
124
+ end
125
+
126
+ def assert_contains_make_command(target, output, msg = nil)
127
+ if output.match(/\n/)
128
+ msg = message(msg) {
129
+ 'Expected output containing make command "%s": %s' % [
130
+ ('%s %s' % [make_command, target]).rstrip,
131
+ output.inspect
132
+ ]
133
+ }
134
+ else
135
+ msg = message(msg) {
136
+ 'Expected make command "%s": %s' % [
137
+ ('%s %s' % [make_command, target]).rstrip,
138
+ output.inspect
139
+ ]
140
+ }
141
+ end
142
+
143
+ assert scan_make_command_lines(output).any? { |line|
144
+ make = parse_make_command_line(line)
145
+
146
+ if make[:targets].include?(target)
147
+ yield make, line if block_given?
148
+ true
149
+ else
150
+ false
151
+ end
152
+ }, msg
153
+ end
154
+
95
155
  include Gem::DefaultUserInteraction
96
156
 
97
157
  undef_method :default_test if instance_methods.include? 'default_test' or
@@ -145,7 +145,7 @@ class Gem::Version
145
145
 
146
146
  include Comparable
147
147
 
148
- VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*' # :nodoc:
148
+ VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*' # :nodoc:
149
149
  ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
150
150
 
151
151
  ##
@@ -0,0 +1,58 @@
1
+ require 'rubygems/test_case'
2
+ require 'rubygems/ext'
3
+
4
+ class TestGemExtBuilder < Gem::TestCase
5
+
6
+ def setup
7
+ super
8
+
9
+ @ext = File.join @tempdir, 'ext'
10
+ @dest_path = File.join @tempdir, 'prefix'
11
+
12
+ FileUtils.mkdir_p @ext
13
+ FileUtils.mkdir_p @dest_path
14
+
15
+ @orig_DESTDIR = ENV['DESTDIR']
16
+ end
17
+
18
+ def teardown
19
+ ENV['DESTDIR'] = @orig_DESTDIR
20
+
21
+ super
22
+ end
23
+
24
+ def test_class_make
25
+ ENV['DESTDIR'] = 'destination'
26
+ results = []
27
+
28
+ Dir.chdir @ext do
29
+ open 'Makefile', 'w' do |io|
30
+ io.puts <<-MAKEFILE
31
+ all:
32
+ \t@#{Gem.ruby} -e "puts %Q{all: \#{ENV['DESTDIR']}}"
33
+
34
+ install:
35
+ \t@#{Gem.ruby} -e "puts %Q{install: \#{ENV['DESTDIR']}}"
36
+ MAKEFILE
37
+ end
38
+
39
+ Gem::Ext::Builder.make @dest_path, results
40
+ end
41
+
42
+ results = results.join "\n"
43
+
44
+
45
+ if RUBY_VERSION > '2.0' then
46
+ assert_match %r%"DESTDIR=#{ENV['DESTDIR']}"$%, results
47
+ assert_match %r%"DESTDIR=#{ENV['DESTDIR']}" install$%, results
48
+ else
49
+ refute_match %r%"DESTDIR=#{ENV['DESTDIR']}"$%, results
50
+ refute_match %r%"DESTDIR=#{ENV['DESTDIR']}" install$%, results
51
+ end
52
+
53
+ assert_match %r%^all: destination$%, results
54
+ assert_match %r%^install: destination$%, results
55
+ end
56
+
57
+ end
58
+
@@ -30,9 +30,9 @@ class TestGemExtConfigureBuilder < Gem::TestCase
30
30
 
31
31
  assert_equal "sh ./configure --prefix=#{@dest_path}", output.shift
32
32
  assert_equal "", output.shift
33
- assert_equal make_command, output.shift
33
+ assert_contains_make_command '', output.shift
34
34
  assert_match(/^ok$/m, output.shift)
35
- assert_equal make_command + " install", output.shift
35
+ assert_contains_make_command 'install', output.shift
36
36
  assert_match(/^ok$/m, output.shift)
37
37
  end
38
38
 
@@ -76,8 +76,8 @@ class TestGemExtConfigureBuilder < Gem::TestCase
76
76
  Gem::Ext::ConfigureBuilder.build nil, nil, @dest_path, output
77
77
  end
78
78
 
79
- assert_equal make_command, output[0]
80
- assert_equal "#{make_command} install", output[2]
79
+ assert_contains_make_command '', output[0]
80
+ assert_contains_make_command 'install', output[2]
81
81
  end
82
82
 
83
83
  end
@@ -1,3 +1,5 @@
1
+ # coding: UTF-8
2
+
1
3
  require 'rubygems/test_case'
2
4
  require 'rubygems/ext'
3
5
 
@@ -25,19 +27,17 @@ class TestGemExtExtConfBuilder < Gem::TestCase
25
27
  output = []
26
28
 
27
29
  Dir.chdir @ext do
28
- Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
30
+ result =
31
+ Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
32
+
33
+ assert_same result, output
29
34
  end
30
35
 
31
36
  assert_match(/^#{Gem.ruby} extconf.rb/, output[0])
32
37
  assert_equal "creating Makefile\n", output[1]
33
- case RUBY_PLATFORM
34
- when /mswin/ then
35
- assert_equal "nmake", output[2]
36
- assert_equal "nmake install", output[4]
37
- else
38
- assert_equal "make", output[2]
39
- assert_equal "make install", output[4]
40
- end
38
+ assert_contains_make_command '', output[2]
39
+ assert_contains_make_command 'install', output[4]
40
+ assert_empty Dir.glob(File.join(@ext, 'siteconf*.rb'))
41
41
  end
42
42
 
43
43
  def test_class_build_rbconfig_make_prog
@@ -54,8 +54,8 @@ class TestGemExtExtConfBuilder < Gem::TestCase
54
54
  end
55
55
 
56
56
  assert_equal "creating Makefile\n", output[1]
57
- assert_equal make_command, output[2]
58
- assert_equal "#{make_command} install", output[4]
57
+ assert_contains_make_command '', output[2]
58
+ assert_contains_make_command 'install', output[4]
59
59
  ensure
60
60
  RbConfig::CONFIG['configure_args'] = configure_args
61
61
  end
@@ -78,7 +78,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
78
78
  end
79
79
 
80
80
  assert_equal "creating Makefile\n", output[1]
81
- assert_equal "anothermake", output[2]
81
+ assert_contains_make_command '', output[2]
82
82
  ensure
83
83
  RbConfig::CONFIG['configure_args'] = configure_args
84
84
  ENV['make'] = env_make
@@ -108,7 +108,43 @@ class TestGemExtExtConfBuilder < Gem::TestCase
108
108
  #{Gem.ruby} extconf.rb.*
109
109
  checking for main\(\) in .*?nonexistent/m, error.message)
110
110
 
111
- assert_match(/^#{Gem.ruby} extconf.rb/, output[0])
111
+ assert_equal("#{Gem.ruby} extconf.rb", output[0])
112
+ end
113
+
114
+ def test_class_build_unconventional
115
+ if vc_windows? && !nmake_found?
116
+ skip("test_class_build skipped - nmake not found")
117
+ end
118
+
119
+ File.open File.join(@ext, 'extconf.rb'), 'w' do |extconf|
120
+ extconf.puts <<-'EXTCONF'
121
+ include RbConfig
122
+
123
+ ruby_exe = "#{CONFIG['RUBY_INSTALL_NAME']}#{CONFIG['EXEEXT']}"
124
+ ruby = File.join CONFIG['bindir'], ruby_exe
125
+
126
+ open 'Makefile', 'w' do |io|
127
+ io.write <<-Makefile
128
+ all: ruby
129
+ install: ruby
130
+
131
+ ruby:
132
+ \t#{ruby} -e0
133
+
134
+ Makefile
135
+ end
136
+ EXTCONF
137
+ end
138
+
139
+ output = []
140
+
141
+ Dir.chdir @ext do
142
+ Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
143
+ end
144
+
145
+ assert_contains_make_command '', output[2]
146
+ assert_contains_make_command 'install', output[4]
147
+ assert_empty Dir.glob(File.join(@ext, 'siteconf*.rb'))
112
148
  end
113
149
 
114
150
  def test_class_make
@@ -119,6 +155,7 @@ checking for main\(\) in .*?nonexistent/m, error.message)
119
155
  output = []
120
156
  makefile_path = File.join(@ext, 'Makefile')
121
157
  File.open makefile_path, 'w' do |makefile|
158
+ makefile.puts "# π"
122
159
  makefile.puts "RUBYARCHDIR = $(foo)$(target_prefix)"
123
160
  makefile.puts "RUBYLIBDIR = $(bar)$(target_prefix)"
124
161
  makefile.puts "all:"
@@ -129,17 +166,8 @@ checking for main\(\) in .*?nonexistent/m, error.message)
129
166
  Gem::Ext::ExtConfBuilder.make @ext, output
130
167
  end
131
168
 
132
- assert_equal make_command, output[0]
133
- assert_equal "#{make_command} install", output[2]
134
-
135
- edited_makefile = <<-EOF
136
- RUBYARCHDIR = #{@ext}$(target_prefix)
137
- RUBYLIBDIR = #{@ext}$(target_prefix)
138
- all:
139
- install:
140
- EOF
141
-
142
- assert_equal edited_makefile, File.read(makefile_path)
169
+ assert_contains_make_command '', output[0]
170
+ assert_contains_make_command 'install', output[2]
143
171
  end
144
172
 
145
173
  def test_class_make_no_Makefile
@@ -117,6 +117,8 @@ class TestGemIndexer < Gem::TestCase
117
117
  assert_indexed @tempdir, "latest_specs.#{@marshal_version}"
118
118
  assert_indexed @tempdir, "latest_specs.#{@marshal_version}.gz"
119
119
 
120
+ single_quote = CGI.escapeHTML "'"
121
+
120
122
  expected = <<-EOF
121
123
  <?xml version=\"1.0\"?>
122
124
  <rss version=\"2.0\">
@@ -227,13 +229,13 @@ class TestGemIndexer < Gem::TestCase
227
229
  <description>
228
230
  &lt;pre&gt;This line is really, really long. So long, in fact, that it is more than
229
231
  eighty characters long! The purpose of this line is for testing wrapping
230
- behavior because sometimes people don't wrap their text to eighty characters.
232
+ behavior because sometimes people don#{single_quote}t wrap their text to eighty characters.
231
233
  Without the wrapping, the text might not look good in the RSS feed.
232
234
 
233
235
  Also, a list:
234
- * An entry that's actually kind of sort
235
- * an entry that's really long, which will probably get wrapped funny.
236
- That's ok, somebody wasn't thinking straight when they made it more than
236
+ * An entry that#{single_quote}s actually kind of sort
237
+ * an entry that#{single_quote}s really long, which will probably get wrapped funny.
238
+ That#{single_quote}s ok, somebody wasn#{single_quote}t thinking straight when they made it more than
237
239
  eighty characters.&lt;/pre&gt;
238
240
  </description>
239
241
  <author>example@example.com (Example), example2@example.com (Example2)</author>
@@ -1031,6 +1031,46 @@ load Gem.bin_path('a', 'executable', version)
1031
1031
  end
1032
1032
  end
1033
1033
 
1034
+ def test_install_extension_flat
1035
+ skip '1.8 mkmf.rb does not create TOUCH' if RUBY_VERSION < '1.9'
1036
+ @spec.require_paths = ["."]
1037
+
1038
+ @spec.extensions << "extconf.rb"
1039
+
1040
+ write_file File.join(@tempdir, "extconf.rb") do |io|
1041
+ io.write <<-RUBY
1042
+ require "mkmf"
1043
+
1044
+ CONFIG['CC'] = '$(TOUCH) $@ ||'
1045
+ CONFIG['LDSHARED'] = '$(TOUCH) $@ ||'
1046
+
1047
+ create_makefile("#{@spec.name}")
1048
+ RUBY
1049
+ end
1050
+
1051
+ # empty depend file for no auto dependencies
1052
+ @spec.files += %W"depend #{@spec.name}.c".each {|file|
1053
+ write_file File.join(@tempdir, file)
1054
+ }
1055
+
1056
+ so = File.join(@gemhome, 'gems', @spec.full_name, "#{@spec.name}.#{RbConfig::CONFIG["DLEXT"]}")
1057
+ assert !File.exist?(so)
1058
+ use_ui @ui do
1059
+ path = Gem::Builder.new(@spec).build
1060
+
1061
+ @installer = Gem::Installer.new path
1062
+ @installer.install
1063
+ end
1064
+ assert File.exist?(so), so
1065
+ rescue
1066
+ puts '-' * 78
1067
+ puts File.read File.join(@gemhome, 'gems', 'a-2', 'Makefile')
1068
+ puts '-' * 78
1069
+ puts File.read File.join(@gemhome, 'gems', 'a-2', 'gem_make.out')
1070
+ puts '-' * 78
1071
+ raise
1072
+ end
1073
+
1034
1074
  def test_installation_satisfies_dependency_eh
1035
1075
  util_setup_install
1036
1076
 
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems-update
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.25
5
- prerelease:
4
+ version: 1.8.26
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jim Weirich
@@ -10,45 +9,62 @@ authors:
10
9
  - Eric Hodel
11
10
  autorequire:
12
11
  bindir: bin
13
- cert_chain: []
14
- date: 2013-01-25 00:00:00.000000000 Z
12
+ cert_chain:
13
+ - |
14
+ -----BEGIN CERTIFICATE-----
15
+ MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMRAwDgYDVQQDDAdkcmJy
16
+ YWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZFgNu
17
+ ZXQwHhcNMTMwMjI4MDUyMjA4WhcNMTQwMjI4MDUyMjA4WjBBMRAwDgYDVQQDDAdk
18
+ cmJyYWluMRgwFgYKCZImiZPyLGQBGRYIc2VnbWVudDcxEzARBgoJkiaJk/IsZAEZ
19
+ FgNuZXQwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCbbgLrGLGIDE76
20
+ LV/cvxdEzCuYuS3oG9PrSZnuDweySUfdp/so0cDq+j8bqy6OzZSw07gdjwFMSd6J
21
+ U5ddZCVywn5nnAQ+Ui7jMW54CYt5/H6f2US6U0hQOjJR6cpfiymgxGdfyTiVcvTm
22
+ Gj/okWrQl0NjYOYBpDi+9PPmaH2RmLJu0dB/NylsDnW5j6yN1BEI8MfJRR+HRKZY
23
+ mUtgzBwF1V4KIZQ8EuL6I/nHVu07i6IkrpAgxpXUfdJQJi0oZAqXurAV3yTxkFwd
24
+ g62YrrW26mDe+pZBzR6bpLE+PmXCzz7UxUq3AE0gPHbiMXie3EFE0oxnsU3lIduh
25
+ sCANiQ8BAgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
26
+ BBS5k4Z75VSpdM0AclG2UvzFA/VW5DAfBgNVHREEGDAWgRRkcmJyYWluQHNlZ21l
27
+ bnQ3Lm5ldDAfBgNVHRIEGDAWgRRkcmJyYWluQHNlZ21lbnQ3Lm5ldDANBgkqhkiG
28
+ 9w0BAQUFAAOCAQEAOflo4Md5aJF//EetzXIGZ2EI5PzKWX/mMpp7cxFyDcVPtTv0
29
+ js/6zWrWSbd60W9Kn4ch3nYiATFKhisgeYotDDz2/pb/x1ivJn4vEvs9kYKVvbF8
30
+ V7MV/O5HDW8Q0pA1SljI6GzcOgejtUMxZCyyyDdbUpyAMdt9UpqTZkZ5z1sicgQk
31
+ 5o2XJ+OhceOIUVqVh1r6DNY5tLVaGJabtBmJAYFVznDcHiSFybGKBa5n25Egql1t
32
+ KDyY1VIazVgoC8XvR4h/95/iScPiuglzA+DBG1hip1xScAtw05BrXyUNrc9CEMYU
33
+ wgF94UVoHRp6ywo8I7NP3HcwFQDFNEZPNGXsng==
34
+ -----END CERTIFICATE-----
35
+ date: 2013-09-09 00:00:00.000000000 Z
15
36
  dependencies:
16
37
  - !ruby/object:Gem::Dependency
17
38
  name: minitest
18
39
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
40
  requirements:
21
41
  - - ~>
22
42
  - !ruby/object:Gem::Version
23
- version: '4.1'
43
+ version: '5.0'
24
44
  type: :development
25
45
  prerelease: false
26
46
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
47
  requirements:
29
48
  - - ~>
30
49
  - !ruby/object:Gem::Version
31
- version: '4.1'
50
+ version: '5.0'
32
51
  - !ruby/object:Gem::Dependency
33
52
  name: rdoc
34
53
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
54
  requirements:
37
55
  - - ~>
38
56
  - !ruby/object:Gem::Version
39
- version: '3.10'
57
+ version: '4.0'
40
58
  type: :development
41
59
  prerelease: false
42
60
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
61
  requirements:
45
62
  - - ~>
46
63
  - !ruby/object:Gem::Version
47
- version: '3.10'
64
+ version: '4.0'
48
65
  - !ruby/object:Gem::Dependency
49
66
  name: builder
50
67
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
68
  requirements:
53
69
  - - ~>
54
70
  - !ruby/object:Gem::Version
@@ -56,7 +72,6 @@ dependencies:
56
72
  type: :development
57
73
  prerelease: false
58
74
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
75
  requirements:
61
76
  - - ~>
62
77
  - !ruby/object:Gem::Version
@@ -64,7 +79,6 @@ dependencies:
64
79
  - !ruby/object:Gem::Dependency
65
80
  name: hoe-seattlerb
66
81
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
82
  requirements:
69
83
  - - ~>
70
84
  - !ruby/object:Gem::Version
@@ -72,7 +86,6 @@ dependencies:
72
86
  type: :development
73
87
  prerelease: false
74
88
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
89
  requirements:
77
90
  - - ~>
78
91
  - !ruby/object:Gem::Version
@@ -80,7 +93,6 @@ dependencies:
80
93
  - !ruby/object:Gem::Dependency
81
94
  name: session
82
95
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
96
  requirements:
85
97
  - - ~>
86
98
  - !ruby/object:Gem::Version
@@ -88,7 +100,6 @@ dependencies:
88
100
  type: :development
89
101
  prerelease: false
90
102
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
103
  requirements:
93
104
  - - ~>
94
105
  - !ruby/object:Gem::Version
@@ -96,7 +107,6 @@ dependencies:
96
107
  - !ruby/object:Gem::Dependency
97
108
  name: rcov
98
109
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
110
  requirements:
101
111
  - - ~>
102
112
  - !ruby/object:Gem::Version
@@ -104,7 +114,6 @@ dependencies:
104
114
  type: :development
105
115
  prerelease: false
106
116
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
117
  requirements:
109
118
  - - ~>
110
119
  - !ruby/object:Gem::Version
@@ -112,7 +121,6 @@ dependencies:
112
121
  - !ruby/object:Gem::Dependency
113
122
  name: ZenTest
114
123
  requirement: !ruby/object:Gem::Requirement
115
- none: false
116
124
  requirements:
117
125
  - - ~>
118
126
  - !ruby/object:Gem::Version
@@ -120,7 +128,6 @@ dependencies:
120
128
  type: :development
121
129
  prerelease: false
122
130
  version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
131
  requirements:
125
132
  - - ~>
126
133
  - !ruby/object:Gem::Version
@@ -128,35 +135,49 @@ dependencies:
128
135
  - !ruby/object:Gem::Dependency
129
136
  name: hoe
130
137
  requirement: !ruby/object:Gem::Requirement
131
- none: false
132
138
  requirements:
133
139
  - - ~>
134
140
  - !ruby/object:Gem::Version
135
- version: '3.0'
141
+ version: '3.7'
136
142
  type: :development
137
143
  prerelease: false
138
144
  version_requirements: !ruby/object:Gem::Requirement
139
- none: false
140
145
  requirements:
141
146
  - - ~>
142
147
  - !ruby/object:Gem::Version
143
- version: '3.0'
144
- description: ! "RubyGems is a package management framework for Ruby.\n\nThis gem is
145
- an update for the RubyGems software. You must have an\ninstallation of RubyGems
146
- before this update can be applied.\n\nSee Gem for information on RubyGems (or `ri
147
- Gem`)\n\nTo upgrade to the latest RubyGems, run:\n\n $ gem update --system # you
148
- might need to be an administrator or root\n\nSee UPGRADING.rdoc for more details
149
- and alternative instructions.\n\n-----\n\nIf you don't have RubyGems installed,
150
- your can still do it manually:\n\n* Download from: https://rubygems.org/pages/download\n*
151
- Unpack into a directory and cd there\n* Install with: ruby setup.rb # you may need
152
- admin/root privilege\n\nFor more details and other options, see:\n\n ruby setup.rb
153
- --help"
148
+ version: '3.7'
149
+ description: |-
150
+ RubyGems is a package management framework for Ruby.
151
+
152
+ This gem is an update for the RubyGems software. You must have an
153
+ installation of RubyGems before this update can be applied.
154
+
155
+ See Gem for information on RubyGems (or `ri Gem`)
156
+
157
+ To upgrade to the latest RubyGems, run:
158
+
159
+ $ gem update --system # you might need to be an administrator or root
160
+
161
+ See UPGRADING.rdoc for more details and alternative instructions.
162
+
163
+ -----
164
+
165
+ If you don't have RubyGems installed, your can still do it manually:
166
+
167
+ * Download from: https://rubygems.org/pages/download
168
+ * Unpack into a directory and cd there
169
+ * Install with: ruby setup.rb # you may need admin/root privilege
170
+
171
+ For more details and other options, see:
172
+
173
+ ruby setup.rb --help
154
174
  email:
155
175
  - rubygems-developers@rubyforge.org
156
176
  executables:
157
177
  - update_rubygems
158
178
  extensions: []
159
179
  extra_rdoc_files:
180
+ - CVE-2013-4287.txt
160
181
  - History.txt
161
182
  - LICENSE.txt
162
183
  - MIT.txt
@@ -167,6 +188,7 @@ extra_rdoc_files:
167
188
  files:
168
189
  - .autotest
169
190
  - .document
191
+ - CVE-2013-4287.txt
170
192
  - History.txt
171
193
  - LICENSE.txt
172
194
  - MIT.txt
@@ -331,6 +353,7 @@ files:
331
353
  - test/rubygems/test_gem_dependency_installer.rb
332
354
  - test/rubygems/test_gem_dependency_list.rb
333
355
  - test/rubygems/test_gem_doc_manager.rb
356
+ - test/rubygems/test_gem_ext_builder.rb
334
357
  - test/rubygems/test_gem_ext_configure_builder.rb
335
358
  - test/rubygems/test_gem_ext_ext_conf_builder.rb
336
359
  - test/rubygems/test_gem_ext_rake_builder.rb
@@ -369,31 +392,32 @@ files:
369
392
  - util/CL2notes
370
393
  - .gemtest
371
394
  homepage: http://rubygems.org
372
- licenses: []
395
+ licenses:
396
+ - Ruby
397
+ - MIT
398
+ metadata: {}
373
399
  post_install_message:
374
400
  rdoc_options:
375
401
  - --main
376
402
  - README.rdoc
377
- - --title=RubyGems 1.8.25 Documentation
403
+ - --title=RubyGems 1.8.26 Documentation
378
404
  require_paths:
379
405
  - hide_lib_for_update
380
406
  required_ruby_version: !ruby/object:Gem::Requirement
381
- none: false
382
407
  requirements:
383
- - - ! '>='
408
+ - - '>='
384
409
  - !ruby/object:Gem::Version
385
410
  version: 1.8.7
386
411
  required_rubygems_version: !ruby/object:Gem::Requirement
387
- none: false
388
412
  requirements:
389
- - - ! '>='
413
+ - - '>='
390
414
  - !ruby/object:Gem::Version
391
415
  version: '0'
392
416
  requirements: []
393
417
  rubyforge_project: rubygems
394
- rubygems_version: 1.8.24
418
+ rubygems_version: 2.1.0
395
419
  signing_key:
396
- specification_version: 3
420
+ specification_version: 4
397
421
  summary: RubyGems is a package management framework for Ruby
398
422
  test_files:
399
423
  - test/rubygems/test_config.rb
@@ -432,6 +456,7 @@ test_files:
432
456
  - test/rubygems/test_gem_dependency_installer.rb
433
457
  - test/rubygems/test_gem_dependency_list.rb
434
458
  - test/rubygems/test_gem_doc_manager.rb
459
+ - test/rubygems/test_gem_ext_builder.rb
435
460
  - test/rubygems/test_gem_ext_configure_builder.rb
436
461
  - test/rubygems/test_gem_ext_ext_conf_builder.rb
437
462
  - test/rubygems/test_gem_ext_rake_builder.rb
metadata.gz.sig ADDED
Binary file