From 25f604f86f9d301881231ae180e2af387eab67fa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 18:10:19 +0000 Subject: [PATCH 1/4] build(deps): bump plist from 3.6.0 to 3.7.0 in /Library/Homebrew Bumps [plist](https://github.com/patsplat/plist) from 3.6.0 to 3.7.0. - [Release notes](https://github.com/patsplat/plist/releases) - [Changelog](https://github.com/patsplat/plist/blob/master/CHANGELOG.rdoc) - [Commits](https://github.com/patsplat/plist/compare/v3.6.0...v3.7.0) --- updated-dependencies: - dependency-name: plist dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Library/Homebrew/Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 8565c13ac0..8567a46f92 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -86,7 +86,7 @@ GEM ast (~> 2.4.1) patchelf (1.4.0) elftools (>= 1.2) - plist (3.6.0) + plist (3.7.0) pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) From be7319bd9877d4c84910e62c9511e5e7debd676e Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Wed, 22 Feb 2023 18:14:20 +0000 Subject: [PATCH 2/4] brew vendor-gems: commit updates. --- .../Homebrew/vendor/bundle/bundler/setup.rb | 2 +- .../{plist-3.6.0 => plist-3.7.0}/lib/plist.rb | 0 .../lib/plist/generator.rb | 0 .../lib/plist/parser.rb | 29 ++++++++++++------- .../lib/plist/version.rb | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{plist-3.6.0 => plist-3.7.0}/lib/plist.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{plist-3.6.0 => plist-3.7.0}/lib/plist/generator.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{plist-3.6.0 => plist-3.7.0}/lib/plist/parser.rb (88%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{plist-3.6.0 => plist-3.7.0}/lib/plist/version.rb (57%) diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 08790c975f..d5a6a8e9ae 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -81,7 +81,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/sorbet-runtime-0.5.10461/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/parlour-8.1.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/patchelf-1.4.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.6.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/plist-3.7.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/pry-0.14.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rack-3.0.4.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unparser-0.6.4/lib") diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist/generator.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist/generator.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist/generator.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist/generator.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist/parser.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist/parser.rb similarity index 88% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist/parser.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist/parser.rb index f325988b05..6b83ed42ed 100755 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist/parser.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist/parser.rb @@ -26,8 +26,13 @@ module Plist # can't be parsed into a Time object, please create an issue # attaching your plist file at https://github.com/patsplat/plist/issues # so folks can implement the proper support. - def self.parse_xml(filename_or_xml) - listener = Listener.new + # + # By default, will be assumed to be a marshaled Ruby object and + # interpreted with Marshal.load. Pass marshal: false + # to disable this behavior and return the raw binary data as an IO + # object instead. + def self.parse_xml(filename_or_xml, options={}) + listener = Listener.new(options) # parser = REXML::Parsers::StreamParser.new(File.new(filename), listener) parser = StreamParser.new(filename_or_xml, listener) parser.parse @@ -39,13 +44,14 @@ module Plist attr_accessor :result, :open - def initialize + def initialize(options={}) @result = nil @open = [] + @options = { :marshal => true }.merge(options).freeze end def tag_start(name, attributes) - @open.push PTag.mappings[name].new + @open.push PTag.mappings[name].new(@options) end def text(contents) @@ -154,9 +160,10 @@ module Plist mappings[key] = sub_class end - attr_accessor :text, :children - def initialize + attr_accessor :text, :children, :options + def initialize(options) @children = [] + @options = options end def to_ruby @@ -244,13 +251,13 @@ module Plist def to_ruby data = Base64.decode64(text.gsub(/\s+/, '')) unless text.nil? begin - return Marshal.load(data) + return Marshal.load(data) if options[:marshal] rescue Exception - io = StringIO.new - io.write data - io.rewind - return io end + io = StringIO.new + io.write data + io.rewind + io end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist/version.rb similarity index 57% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist/version.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist/version.rb index 936004a70b..4d1d5685f6 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.6.0/lib/plist/version.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/plist-3.7.0/lib/plist/version.rb @@ -1,5 +1,5 @@ # encoding: utf-8 module Plist - VERSION = '3.6.0'.freeze + VERSION = '3.7.0'.freeze end From f5cd81be7ee35a12b1338fa61de3eadaa3dbe025 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Wed, 22 Feb 2023 18:21:36 +0000 Subject: [PATCH 3/4] Update RBI files for plist. Autogenerated by the [vendor-gems](https://github.com/Homebrew/brew/blob/HEAD/.github/workflows/vendor-gems.yml) workflow. --- .../sorbet/rbi/gems/{plist@3.6.0.rbi => plist@3.7.0.rbi} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename Library/Homebrew/sorbet/rbi/gems/{plist@3.6.0.rbi => plist@3.7.0.rbi} (93%) diff --git a/Library/Homebrew/sorbet/rbi/gems/plist@3.6.0.rbi b/Library/Homebrew/sorbet/rbi/gems/plist@3.7.0.rbi similarity index 93% rename from Library/Homebrew/sorbet/rbi/gems/plist@3.6.0.rbi rename to Library/Homebrew/sorbet/rbi/gems/plist@3.7.0.rbi index 4e521bb855..d621be496b 100644 --- a/Library/Homebrew/sorbet/rbi/gems/plist@3.6.0.rbi +++ b/Library/Homebrew/sorbet/rbi/gems/plist@3.7.0.rbi @@ -6,7 +6,7 @@ module Plist class << self - def parse_xml(filename_or_xml); end + def parse_xml(filename_or_xml, options = T.unsafe(nil)); end end end @@ -38,7 +38,7 @@ class Plist::Emit::PlistBuilder end class Plist::Listener - def initialize; end + def initialize(options = T.unsafe(nil)); end def open; end def open=(_arg0); end @@ -90,10 +90,12 @@ class Plist::PString < ::Plist::PTag end class Plist::PTag - def initialize; end + def initialize(options); end def children; end def children=(_arg0); end + def options; end + def options=(_arg0); end def text; end def text=(_arg0); end def to_ruby; end From 5ecf76a61147880df1226682d41b23e19a942c8c Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Wed, 22 Feb 2023 22:52:06 +0000 Subject: [PATCH 4/4] Harden plist parsing --- Library/Homebrew/formula_cellar_checks.rb | 2 +- Library/Homebrew/system_command.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index dfdd699e6a..700ed7c0ad 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -232,7 +232,7 @@ module FormulaCellarChecks return unless prefix.directory? plist = begin - Plist.parse_xml(plist) + Plist.parse_xml(plist, marshal: false) rescue nil end diff --git a/Library/Homebrew/system_command.rb b/Library/Homebrew/system_command.rb index 4f5b68e38c..3ddd2a039b 100644 --- a/Library/Homebrew/system_command.rb +++ b/Library/Homebrew/system_command.rb @@ -357,7 +357,7 @@ class SystemCommand Regexp.last_match(1) end - Plist.parse_xml(output) + Plist.parse_xml(output, marshal: false) end end