From a8087fb6b53f685383ba20807b7de7acd01af0b3 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 29 Jan 2020 12:06:23 +0000 Subject: [PATCH] Add a couple of upstream patches. --- ...vex-Regedit-Accept-CRLF-line-endings.patch | 24 +++++++++++++ 0002-Win-Hivex-Regedit-Ignore-comments.patch | 36 +++++++++++++++++++ hivex.spec | 9 ++++- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 0001-Win-Hivex-Regedit-Accept-CRLF-line-endings.patch create mode 100644 0002-Win-Hivex-Regedit-Ignore-comments.patch diff --git a/0001-Win-Hivex-Regedit-Accept-CRLF-line-endings.patch b/0001-Win-Hivex-Regedit-Accept-CRLF-line-endings.patch new file mode 100644 index 0000000..f810c40 --- /dev/null +++ b/0001-Win-Hivex-Regedit-Accept-CRLF-line-endings.patch @@ -0,0 +1,24 @@ +From 564a923a91d042e24e9259d86f69e0061f28ef4f Mon Sep 17 00:00:00 2001 +From: Vladimir Panteleev +Date: Thu, 16 Jan 2020 12:11:20 +0000 +Subject: [PATCH 1/2] Win::Hivex::Regedit: Accept CRLF line endings + +--- + perl/lib/Win/Hivex/Regedit.pm | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/perl/lib/Win/Hivex/Regedit.pm b/perl/lib/Win/Hivex/Regedit.pm +index 34426f1..2b17036 100644 +--- a/perl/lib/Win/Hivex/Regedit.pm ++++ b/perl/lib/Win/Hivex/Regedit.pm +@@ -144,6 +144,7 @@ sub reg_import + # this is fairly common in pasted regedit files. + $lineno++; + chomp; ++ s/\r$//; + if (s/\\\s*$//) { + $_ .= <$fh>; + redo unless eof ($fh); +-- +2.24.1 + diff --git a/0002-Win-Hivex-Regedit-Ignore-comments.patch b/0002-Win-Hivex-Regedit-Ignore-comments.patch new file mode 100644 index 0000000..8ba089f --- /dev/null +++ b/0002-Win-Hivex-Regedit-Ignore-comments.patch @@ -0,0 +1,36 @@ +From 003028c3c0d33e952430d3f4e1a987a777674eb3 Mon Sep 17 00:00:00 2001 +From: Vladimir Panteleev +Date: Thu, 16 Jan 2020 12:11:21 +0000 +Subject: [PATCH 2/2] Win::Hivex::Regedit: Ignore comments + +--- + perl/lib/Win/Hivex/Regedit.pm | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/perl/lib/Win/Hivex/Regedit.pm b/perl/lib/Win/Hivex/Regedit.pm +index 2b17036..f0dbb50 100644 +--- a/perl/lib/Win/Hivex/Regedit.pm ++++ b/perl/lib/Win/Hivex/Regedit.pm +@@ -153,8 +153,8 @@ sub reg_import + #print STDERR "reg_import: parsing <<<$_>>>\n"; + + if ($state eq "outer") { +- # Ignore blank lines, headers. +- next if /^\s*$/; ++ # Ignore blank lines, headers, comments. ++ next if /^\s*(;.*)?$/; + + # .* is needed before Windows Registry Editor Version.. in + # order to eat a possible Unicode BOM which regedit writes +@@ -193,7 +193,7 @@ sub reg_import + my $value = _parse_value ("", $1, $encoding); + croak (_parse_error ($_, $lineno)) unless defined $value; + push @newvalues, $value; +- } elsif (/^\s*$/) { # blank line after values ++ } elsif (/^\s*(;.*)?$/) { # blank line after values + _merge_node ($hmap, \%params, $newnode, \@newvalues, \@delvalues); + $state = "outer"; + } else { +-- +2.24.1 + diff --git a/hivex.spec b/hivex.spec index cace554..8bbbed5 100644 --- a/hivex.spec +++ b/hivex.spec @@ -10,7 +10,7 @@ Name: hivex Version: 1.3.18 -Release: 19%{?dist} +Release: 20%{?dist} Summary: Read and write Windows Registry binary hive files License: LGPLv2 @@ -26,6 +26,10 @@ Source1: http://libguestfs.org/download/hivex/%{name}-%{version}.tar.gz.s Source2: libguestfs.keyring %endif +# Patches - all upstream since 1.3.18. +Patch0001: 0001-Win-Hivex-Regedit-Accept-CRLF-line-endings.patch +Patch0002: 0002-Win-Hivex-Regedit-Ignore-comments.patch + BuildRequires: perl-interpreter BuildRequires: perl-devel BuildRequires: perl-generators @@ -283,6 +287,9 @@ fi %changelog +* Wed Jan 29 2020 Richard W.M. Jones - 1.3.18-20 +- Add a couple of upstream patches. + * Wed Jan 29 2020 Fedora Release Engineering - 1.3.18-19 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild