summaryrefslogtreecommitdiff
path: root/lib/bundler/errors.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-10-03 14:37:44 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-11-08 09:04:28 +0900
commita131ea39b7b9c34304dfbf8112581c49ce9ff827 (patch)
tree9e733fa21cb957a2d0ed425f2a19466534c3936e /lib/bundler/errors.rb
parent05ea3bcf14f27e1b3c6d7dd97889d02f988b8920 (diff)
[rubygems/rubygems] Better error when having an insecure install folder
https://github.com/rubygems/rubygems/commit/e41156e272
Diffstat (limited to 'lib/bundler/errors.rb')
-rw-r--r--lib/bundler/errors.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/bundler/errors.rb b/lib/bundler/errors.rb
index c6b3cec4dc..eec72b1692 100644
--- a/lib/bundler/errors.rb
+++ b/lib/bundler/errors.rb
@@ -215,4 +215,19 @@ module Bundler
status_code(36)
end
+
+ class InsecureInstallPathError < BundlerError
+ def initialize(path)
+ @path = path
+ end
+
+ def message
+ "The installation path is insecure. Bundler cannot continue.\n" \
+ "#{@path} is world-writable (without sticky bit).\n" \
+ "Bundler cannot safely replace gems in world-writeable directories due to potential vulnerabilities.\n" \
+ "Please change the permissions of this directory or choose a different install path."
+ end
+
+ status_code(38)
+ end
end