[ruby/rubygems] We no longer need to check realpaths
Since symlinks and absolute paths are already checked. https://github.com/rubygems/rubygems/commit/de19bc4c7e
This commit is contained in:
parent
bbcf8f87ac
commit
6c39a272af
@ -488,16 +488,6 @@ EOM
|
|||||||
raise Gem::Package::PathError.new(destination, destination_dir) unless
|
raise Gem::Package::PathError.new(destination, destination_dir) unless
|
||||||
normalize_path(destination).start_with? normalize_path(destination_dir + '/')
|
normalize_path(destination).start_with? normalize_path(destination_dir + '/')
|
||||||
|
|
||||||
begin
|
|
||||||
real_destination = File.expand_path(File.realpath(destination))
|
|
||||||
rescue
|
|
||||||
# it's fine if the destination doesn't exist, because rm -rf'ing it can't cause any damage
|
|
||||||
nil
|
|
||||||
else
|
|
||||||
raise Gem::Package::PathError.new(real_destination, destination_dir) unless
|
|
||||||
real_destination.start_with? destination_dir + '/'
|
|
||||||
end
|
|
||||||
|
|
||||||
destination.tap(&Gem::UNTAINT)
|
destination.tap(&Gem::UNTAINT)
|
||||||
destination
|
destination
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user