mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Merge RubyGems 2.7.6 from upstream.
It fixed some security vulnerabilities. http://blog.rubygems.org/2018/02/15/2.7.6-released.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a453b1576
commit
7619cb3d7d
15 changed files with 389 additions and 27 deletions
|
@ -104,25 +104,30 @@ class Gem::Package::TarHeader
|
|||
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+
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue