Hello community, here is the log from the commit of package yast2-registration for openSUSE:Factory checked in at 2020-07-30 09:59:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old) and /work/SRC/openSUSE:Factory/.yast2-registration.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-registration" Thu Jul 30 09:59:44 2020 rev:57 rq:823074 version:4.3.5 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes 2020-07-21 15:48:39.328166972 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-registration.new.3592/yast2-registration.changes 2020-07-30 10:00:08.599222750 +0200 @@ -1,0 +2,6 @@ +Tue Jul 28 07:20:28 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- Handle exceptions when parsing xml file (related to bsc#1170886) +- 4.3.5 + +------------------------------------------------------------------- Old: ---- yast2-registration-4.3.4.tar.bz2 New: ---- yast2-registration-4.3.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.UXKUuM/_old 2020-07-30 10:00:09.391223223 +0200 +++ /var/tmp/diff_new_pack.UXKUuM/_new 2020-07-30 10:00:09.399223228 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.3.4 +Version: 4.3.5 Release: 0 Summary: YaST2 - Registration Module License: GPL-2.0-only ++++++ yast2-registration-4.3.4.tar.bz2 -> yast2-registration-4.3.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.3.4/package/yast2-registration.changes new/yast2-registration-4.3.5/package/yast2-registration.changes --- old/yast2-registration-4.3.4/package/yast2-registration.changes 2020-07-19 23:20:54.000000000 +0200 +++ new/yast2-registration-4.3.5/package/yast2-registration.changes 2020-07-28 09:33:33.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Tue Jul 28 07:20:28 UTC 2020 - Josef Reidinger <jreidin...@suse.com> + +- Handle exceptions when parsing xml file (related to bsc#1170886) +- 4.3.5 + +------------------------------------------------------------------- Fri Jul 17 10:54:41 UTC 2020 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> - Export the registration settings in the <suse_register/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.3.4/package/yast2-registration.spec new/yast2-registration-4.3.5/package/yast2-registration.spec --- old/yast2-registration-4.3.4/package/yast2-registration.spec 2020-07-19 23:20:54.000000000 +0200 +++ new/yast2-registration-4.3.5/package/yast2-registration.spec 2020-07-28 09:33:33.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.3.4 +Version: 4.3.5 Release: 0 Summary: YaST2 - Registration Module License: GPL-2.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.3.4/src/lib/registration/registration_codes_loader.rb new/yast2-registration-4.3.5/src/lib/registration/registration_codes_loader.rb --- old/yast2-registration-4.3.4/src/lib/registration/registration_codes_loader.rb 2020-07-19 23:20:54.000000000 +0200 +++ new/yast2-registration-4.3.5/src/lib/registration/registration_codes_loader.rb 2020-07-28 09:33:33.000000000 +0200 @@ -34,6 +34,7 @@ module RegistrationCodesLoader include Yast::I18n # missing in yast2-update include Yast::Transfer::FileFromUrl + include Yast::Logger REGCODES_NAME_HANDLERS = { "regcodes.xml" => :reg_codes_from_xml, @@ -83,6 +84,9 @@ return nil unless File.readable?(filename) && File.file?(filename) xml_hash = Yast::XML.XMLToYCPFile(filename) parse_xml(xml_hash) + rescue Yast::XMLDeserializationError => e + log.error "Invalid reg codes XML: #{e.inspect}" + return nil end # @param xml_hash [Hash] as used in AY and returned by Yast::XML.XMLToYCPFile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.3.4/test/registration_codes_loader_spec.rb new/yast2-registration-4.3.5/test/registration_codes_loader_spec.rb --- old/yast2-registration-4.3.4/test/registration_codes_loader_spec.rb 2020-07-19 23:20:54.000000000 +0200 +++ new/yast2-registration-4.3.5/test/registration_codes_loader_spec.rb 2020-07-28 09:33:33.000000000 +0200 @@ -143,6 +143,12 @@ expect(subject.reg_codes_from_xml("/etc")).to eq(nil) end + it "returns nil if xml is not valid" do + allow(Yast::XML).to receive(:XMLToYCPFile).and_raise(Yast::XMLDeserializationError) + filename = fixtures_file("regcodes.xml") + expect(subject.reg_codes_from_xml(filename)).to eq nil + end + it "parses a valid fixture" do filename = fixtures_file("regcodes.xml") expect(subject.reg_codes_from_xml(filename)).to eq(valid_fixture_codes)