diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2023-10-26 18:44:20 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-11-08 09:04:28 +0900 |
commit | 7f7a7f13ededda5c91d84c3493dc6ef3cec53d1a (patch) | |
tree | f3a8351a266cb8ce84111c8a1203886d2c6b7d98 /lib/bundler/rubygems_gem_installer.rb | |
parent | 2d719cd1468334a3507e4194a173da743b9987d1 (diff) | |
download | ruby-7f7a7f13ededda5c91d84c3493dc6ef3cec53d1a.tar.gz |
[rubygems/rubygems] Don't show bug report template when GEM_HOME has no writable bit
Instead, don't check that at all and proceed. If something fails to be
written inside GEM_HOME, we'll eventually fail with a proper permissions
error.
In addition to that, the writable bit in GEM_HOME is not even reliable,
because only the immediate parent is actually checked when writing. For
example,
```
$ mkdir -p foo/bar
$ chmod -w foo
$ touch foo/bar/baz # writes without issue
```
https://github.com/rubygems/rubygems/commit/4bced7ac73
Diffstat (limited to 'lib/bundler/rubygems_gem_installer.rb')
-rw-r--r-- | lib/bundler/rubygems_gem_installer.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/rubygems_gem_installer.rb b/lib/bundler/rubygems_gem_installer.rb index 4d0e1c3fcc..8463b24bfa 100644 --- a/lib/bundler/rubygems_gem_installer.rb +++ b/lib/bundler/rubygems_gem_installer.rb @@ -45,6 +45,14 @@ module Bundler spec end + def pre_install_checks + super + rescue Gem::FilePermissionError + # Ignore permission checks in RubyGems. Instead, go on, and try to write + # for real. We properly handle permission errors when they happen. + nil + end + def generate_plugins return unless Gem::Installer.instance_methods(false).include?(:generate_plugins) |