diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2016-07-15 13:36:31 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-07-19 17:13:45 -0500 |
commit | e7b4b41cd026883816a6fdb431a9b2cb91f59c09 (patch) | |
tree | b009039efa99bc1f332f6e4c8ee3708d4715d2ff | |
parent | 752ad8a4c10d6f43eecbfdf8b6a3c7f692ab9692 (diff) | |
download | bundler-seg-gem-dep-api-compatibility.tar.gz |
Mild 1.8.7 $SAFE=1 compatibilityseg-gem-dep-api-compatibility
-rw-r--r-- | lib/bundler/dsl.rb | 2 | ||||
-rw-r--r-- | lib/bundler/rubygems_ext.rb | 2 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 7 | ||||
-rw-r--r-- | lib/bundler/shared_helpers.rb | 8 |
4 files changed, 10 insertions, 9 deletions
diff --git a/lib/bundler/dsl.rb b/lib/bundler/dsl.rb index 0436b58f3a..4cd56e5e8d 100644 --- a/lib/bundler/dsl.rb +++ b/lib/bundler/dsl.rb @@ -38,7 +38,7 @@ module Bundler original_gemfile = @gemfile @gemfile = expanded_gemfile_path contents ||= Bundler.read_file(gemfile.to_s) - instance_eval(contents, gemfile.to_s, 1) + instance_eval(contents.dup.untaint, gemfile.to_s, 1) rescue Exception => e message = "There was an error " \ "#{e.is_a?(GemfileEvalError) ? "evaluating" : "parsing"} " \ diff --git a/lib/bundler/rubygems_ext.rb b/lib/bundler/rubygems_ext.rb index 60b17faf63..fc8eadd186 100644 --- a/lib/bundler/rubygems_ext.rb +++ b/lib/bundler/rubygems_ext.rb @@ -16,7 +16,7 @@ module Gem class Specification attr_accessor :remote, :location, :relative_loaded_from - if instance_methods(false).include?(:source) + if instance_methods(false).map(&:to_sym).include?(:source) remove_method :source attr_writer :source def source diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index ff0b146054..67ae20ff8a 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -276,11 +276,12 @@ module Bundler }xo def load_config(config_file) - SharedHelpers.filesystem_access(config_file, :read) do - valid_file = config_file && config_file.exist? && !config_file.size.zero? + return unless config_file + SharedHelpers.filesystem_access(config_file, :read) do |file| + valid_file = file.exist? && !file.size.zero? return {} if ignore_config? || !valid_file require "bundler/yaml_serializer" - YAMLSerializer.load config_file.read + YAMLSerializer.load file.read end end diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index efbedeb374..69543356a2 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -23,7 +23,7 @@ module Bundler def default_gemfile gemfile = find_gemfile raise GemfileNotFound, "Could not locate Gemfile" unless gemfile - Pathname.new(gemfile) + Pathname.new(gemfile).untaint end def default_lockfile @@ -32,7 +32,7 @@ module Bundler case gemfile.basename.to_s when "gems.rb" then Pathname.new(gemfile.sub(/.rb$/, ".locked")) else Pathname.new("#{gemfile}.lock") - end + end.untaint end def default_bundle_dir @@ -102,7 +102,7 @@ module Bundler # # @see {Bundler::PermissionError} def filesystem_access(path, action = :write) - yield path + yield path.dup.untaint rescue Errno::EACCES raise PermissionError.new(path, action) rescue Errno::EAGAIN @@ -158,7 +158,7 @@ module Bundler def search_up(*names) previous = nil - current = File.expand_path(SharedHelpers.pwd) + current = File.expand_path(SharedHelpers.pwd).untaint until !File.directory?(current) || current == previous if ENV["BUNDLE_SPEC_RUN"] |