[前][次][番号順一覧][スレッド一覧]

ruby-changes:68361

From: David <ko1@a...>
Date: Sun, 10 Oct 2021 23:13:11 +0900 (JST)
Subject: [ruby-changes:68361] 6c39a272af (master): [ruby/rubygems] We no longer need to check realpaths

https://git.ruby-lang.org/ruby.git/commit/?id=6c39a272af

From 6c39a272af7dc3c1df95ae16a2b8904bd67ffcf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Wed, 6 Oct 2021 19:00:46 +0200
Subject: [ruby/rubygems] We no longer need to check realpaths

Since symlinks and absolute paths are already checked.

https://github.com/rubygems/rubygems/commit/de19bc4c7e
---
 lib/rubygems/package.rb | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/lib/rubygems/package.rb b/lib/rubygems/package.rb
index 0ca272e099..94705914af 100644
--- a/lib/rubygems/package.rb
+++ b/lib/rubygems/package.rb
@@ -488,16 +488,6 @@ EOM https://github.com/ruby/ruby/blob/trunk/lib/rubygems/package.rb#L488
     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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]