Skip to content

Commit

Permalink
[ruby/rubygems] We no longer need to check realpaths
Browse files Browse the repository at this point in the history
Since symlinks and absolute paths are already checked.

rubygems/rubygems@de19bc4c7e
  • Loading branch information
deivid-rodriguez authored and matzbot committed Oct 10, 2021
1 parent bbcf8f8 commit 6c39a27
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions lib/rubygems/package.rb
Expand Up @@ -488,16 +488,6 @@ def install_location(filename, destination_dir) # :nodoc:
raise Gem::Package::PathError.new(destination, destination_dir) unless
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
end
Expand Down

0 comments on commit 6c39a27

Please sign in to comment.