diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8537539 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/Storable-2.51.tar.gz diff --git a/.rh-perl524-perl-Storable.metadata b/.rh-perl524-perl-Storable.metadata new file mode 100644 index 0000000..8730896 --- /dev/null +++ b/.rh-perl524-perl-Storable.metadata @@ -0,0 +1 @@ +3ccd6ac2b898aa589ac5c6dd73d6b600f5192a47 SOURCES/Storable-2.51.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/Storable-2.51-Upgrade-to-2.53.patch b/SOURCES/Storable-2.51-Upgrade-to-2.53.patch new file mode 100644 index 0000000..f88f45f --- /dev/null +++ b/SOURCES/Storable-2.51-Upgrade-to-2.53.patch @@ -0,0 +1,307 @@ +From fd2e79041c553c1220c6eca796293873246c5682 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 6 May 2015 09:39:53 +0200 +Subject: [PATCH] Upgrade to 2.53 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Petr Písař +--- + ChangeLog | 2 +- + MANIFEST | 3 +++ + Storable.pm | 6 +++--- + t/attach.t | 42 ++++++++++++++++++++++++++++++++++++ + t/attach_errors.t | 2 +- + t/canonical.t | 2 +- + t/code.t | 2 +- + t/leaks.t | 34 +++++++++++++++++++++++++++++ + t/tied_store.t | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + t/utf8.t | 6 ++++-- + 10 files changed, 154 insertions(+), 9 deletions(-) + create mode 100644 t/attach.t + create mode 100644 t/leaks.t + create mode 100644 t/tied_store.t + +diff --git a/ChangeLog b/ChangeLog +index 4df921e..cbfdbab 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -209,7 +209,7 @@ Fri Jun 7 23:55:41 BST 2002 Nicholas Clark + The bug was introduced as development perl change 16442 (on + 2002/05/07), so has been present since 2.00. + Patches to introduce more regression tests to reduce the chance of +- a reoccurence of this sort of goof are always welcome. ++ a reoccurrence of this sort of goof are always welcome. + + Thu May 30 20:31:08 BST 2002 Nicholas Clark + +diff --git a/MANIFEST b/MANIFEST +index 84b72f1..2f5b725 100644 +--- a/MANIFEST ++++ b/MANIFEST +@@ -9,6 +9,7 @@ ppport.h + README + Storable.pm + Storable.xs ++t/attach.t + t/attach_errors.t + t/attach_singleton.t + t/blessed.t +@@ -33,6 +34,7 @@ t/HAS_OVERLOAD.pm + t/integer.t + t/interwork56.t + t/just_plain_nasty.t ++t/leaks.t + t/lock.t + t/make_56_interwork.pl + t/make_downgrade.pl +@@ -51,6 +53,7 @@ t/threads.t + t/tied.t + t/tied_hook.t + t/tied_items.t ++t/tied_store.t + t/utf8.t + t/utf8hash.t + t/weak.t +diff --git a/Storable.pm b/Storable.pm +index 839c1d1..9d8b621 100644 +--- a/Storable.pm ++++ b/Storable.pm +@@ -22,7 +22,7 @@ package Storable; @ISA = qw(Exporter); + + use vars qw($canonical $forgive_me $VERSION); + +-$VERSION = '2.51'; ++$VERSION = '2.53'; + + BEGIN { + if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) { +@@ -1088,8 +1088,8 @@ deal with them. + + The store functions will C if they run into such references + unless you set C<$Storable::forgive_me> to some C value. In that +-case, the fatal message is turned in a warning and some +-meaningless string is stored instead. ++case, the fatal message is converted to a warning and some meaningless ++string is stored instead. + + Setting C<$Storable::canonical> may not yield frozen strings that + compare equal due to possible stringification of numbers. When the +diff --git a/t/attach.t b/t/attach.t +new file mode 100644 +index 0000000..5ffdae5 +--- /dev/null ++++ b/t/attach.t +@@ -0,0 +1,42 @@ ++#!./perl -w ++# ++# This file tests that Storable correctly uses STORABLE_attach hooks ++ ++sub BEGIN { ++ unshift @INC, 't'; ++ unshift @INC, 't/compat' if $] < 5.006002; ++ require Config; import Config; ++ if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { ++ print "1..0 # Skip: Storable was not built\n"; ++ exit 0; ++ } ++} ++ ++use Test::More tests => 3; ++use Storable (); ++ ++{ ++ my $destruct_cnt = 0; ++ my $obj = bless {data => 'ok'}, 'My::WithDestructor'; ++ my $target = Storable::thaw( Storable::freeze( $obj ) ); ++ is( $target->{data}, 'ok', 'We got correct object after freeze/thaw' ); ++ is( $destruct_cnt, 0, 'No tmp objects created by Storable' ); ++ undef $obj; ++ undef $target; ++ is( $destruct_cnt, 2, 'Only right objects destroyed at the end' ); ++ ++ package My::WithDestructor; ++ ++ sub STORABLE_freeze { ++ my ($self, $clone) = @_; ++ return $self->{data}; ++ } ++ ++ sub STORABLE_attach { ++ my ($class, $clone, $string) = @_; ++ return bless {data => $string}, 'My::WithDestructor'; ++ } ++ ++ sub DESTROY { $destruct_cnt++; } ++} ++ +diff --git a/t/attach_errors.t b/t/attach_errors.t +index c163ca0..6cebd97 100644 +--- a/t/attach_errors.t ++++ b/t/attach_errors.t +@@ -234,7 +234,7 @@ use Storable (); + isa_ok( $thawed->[1], 'My::GoodAttach::MultipleReferences' ); + + is($thawed->[0], $thawed->[1], 'References to the same object are attached properly'); +- is($thawed->[1]{id}, $obj->{id}, 'Object with multiple references attchached properly'); ++ is($thawed->[1]{id}, $obj->{id}, 'Object with multiple references attached properly'); + + package My::GoodAttach::MultipleReferences; + +diff --git a/t/canonical.t b/t/canonical.t +index 23e012f..35046de 100644 +--- a/t/canonical.t ++++ b/t/canonical.t +@@ -34,7 +34,7 @@ $maxarraysize = 100; + + eval { require Digest::MD5; }; + $gotmd5 = !$@; +-diag "Will use Digest::MD5" if $gotmd5; ++note "Will use Digest::MD5" if $gotmd5; + + # Use Data::Dumper if debugging and it is available to create an ASCII dump + +diff --git a/t/code.t b/t/code.t +index c383142..7fc40ba 100644 +--- a/t/code.t ++++ b/t/code.t +@@ -102,7 +102,7 @@ is($thawed->{"b"}->(), "JAPH"); + $freezed = freeze $obj[2]; + $thawed = thaw $freezed; + +-is($thawed->(), 42); ++is($thawed->(), (ord "A") == 193 ? -118 : 42); + + ###################################################################### + +diff --git a/t/leaks.t b/t/leaks.t +new file mode 100644 +index 0000000..06360d6 +--- /dev/null ++++ b/t/leaks.t +@@ -0,0 +1,34 @@ ++#!./perl ++ ++use Test::More; ++use Storable (); ++BEGIN { ++eval "use Test::LeakTrace"; ++plan 'skip_all' => 'Test::LeakTrace required for this tests' if $@; ++} ++plan 'tests' => 1; ++ ++{ ++ my $c = My::Simple->new; ++ my $d; ++ my $freezed = Storable::freeze($c); ++ no_leaks_ok ++ { ++ $d = Storable::thaw($freezed); ++ undef $d; ++ }; ++ ++ package My::Simple; ++ sub new { ++ my ($class, $arg) = @_; ++ bless {t=>$arg}, $class; ++ } ++ sub STORABLE_freeze { ++ return "abcderfgh"; ++ } ++ sub STORABLE_attach { ++ my ($class, $c, $serialized) = @_; ++ return $class->new($serialized); ++ } ++} ++ +diff --git a/t/tied_store.t b/t/tied_store.t +new file mode 100644 +index 0000000..c657f95 +--- /dev/null ++++ b/t/tied_store.t +@@ -0,0 +1,64 @@ ++#!./perl ++ ++sub BEGIN { ++ unshift @INC, 't'; ++ unshift @INC, 't/compat' if $] < 5.006002; ++ require Config; import Config; ++ if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) { ++ print "1..0 # Skip: Storable was not built\n"; ++ exit 0; ++ } ++} ++ ++use Storable (); ++use Test::More tests => 3; ++ ++our $f; ++ ++package TIED_HASH; ++ ++sub TIEHASH { bless({}, $_[0]) } ++ ++sub STORE { ++ $f = Storable::freeze(\$_[2]); ++ 1; ++} ++ ++package TIED_ARRAY; ++ ++sub TIEARRAY { bless({}, $_[0]) } ++ ++sub STORE { ++ $f = Storable::freeze(\$_[2]); ++ 1; ++} ++ ++package TIED_SCALAR; ++ ++sub TIESCALAR { bless({}, $_[0]) } ++ ++sub STORE { ++ $f = Storable::freeze(\$_[1]); ++ 1; ++} ++ ++package main; ++ ++my($s, @a, %h); ++tie $s, "TIED_SCALAR"; ++tie @a, "TIED_ARRAY"; ++tie %h, "TIED_HASH"; ++ ++$f = undef; ++$s = 111; ++is $f, Storable::freeze(\111); ++ ++$f = undef; ++$a[3] = 222; ++is $f, Storable::freeze(\222); ++ ++$f = undef; ++$h{foo} = 333; ++is $f, Storable::freeze(\333); ++ ++1; +diff --git a/t/utf8.t b/t/utf8.t +index fd20ef6..a8dd6cd 100644 +--- a/t/utf8.t ++++ b/t/utf8.t +@@ -32,8 +32,10 @@ is($x, ${thaw freeze \$x}); + $x = join '', map {chr $_} (0..1023); + is($x, ${thaw freeze \$x}); + +-# Char in the range 127-255 (probably) in utf8 +-$x = chr (175) . chr (256); ++# Char in the range 127-255 (probably) in utf8. This just won't work for ++# EBCDIC for early Perls. ++$x = ($] lt 5.007_003) ? chr(175) : chr(utf8::unicode_to_native(175)) ++ . chr (256); + chop $x; + is($x, ${thaw freeze \$x}); + +-- +2.1.0 + diff --git a/SOURCES/Storable-2.53-Upgrade-to-2.56.patch b/SOURCES/Storable-2.53-Upgrade-to-2.56.patch new file mode 100644 index 0000000..5ab0425 --- /dev/null +++ b/SOURCES/Storable-2.53-Upgrade-to-2.56.patch @@ -0,0 +1,99 @@ +diff --git a/Storable.pm b/Storable.pm +index 9d8b621..c8f6db1 100644 +--- a/Storable.pm ++++ b/Storable.pm +@@ -22,7 +22,7 @@ package Storable; @ISA = qw(Exporter); + + use vars qw($canonical $forgive_me $VERSION); + +-$VERSION = '2.53'; ++$VERSION = '2.56'; + + BEGIN { + if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) { +@@ -979,43 +979,43 @@ such. + + Here are some code samples showing a possible usage of Storable: + +- use Storable qw(store retrieve freeze thaw dclone); ++ use Storable qw(store retrieve freeze thaw dclone); + +- %color = ('Blue' => 0.1, 'Red' => 0.8, 'Black' => 0, 'White' => 1); ++ %color = ('Blue' => 0.1, 'Red' => 0.8, 'Black' => 0, 'White' => 1); + +- store(\%color, 'mycolors') or die "Can't store %a in mycolors!\n"; ++ store(\%color, 'mycolors') or die "Can't store %a in mycolors!\n"; + +- $colref = retrieve('mycolors'); +- die "Unable to retrieve from mycolors!\n" unless defined $colref; +- printf "Blue is still %lf\n", $colref->{'Blue'}; ++ $colref = retrieve('mycolors'); ++ die "Unable to retrieve from mycolors!\n" unless defined $colref; ++ printf "Blue is still %lf\n", $colref->{'Blue'}; + +- $colref2 = dclone(\%color); ++ $colref2 = dclone(\%color); + +- $str = freeze(\%color); +- printf "Serialization of %%color is %d bytes long.\n", length($str); +- $colref3 = thaw($str); ++ $str = freeze(\%color); ++ printf "Serialization of %%color is %d bytes long.\n", length($str); ++ $colref3 = thaw($str); + + which prints (on my machine): + +- Blue is still 0.100000 +- Serialization of %color is 102 bytes long. ++ Blue is still 0.100000 ++ Serialization of %color is 102 bytes long. + + Serialization of CODE references and deserialization in a safe + compartment: + + =for example begin + +- use Storable qw(freeze thaw); +- use Safe; +- use strict; +- my $safe = new Safe; ++ use Storable qw(freeze thaw); ++ use Safe; ++ use strict; ++ my $safe = new Safe; + # because of opcodes used in "use strict": +- $safe->permit(qw(:default require)); +- local $Storable::Deparse = 1; +- local $Storable::Eval = sub { $safe->reval($_[0]) }; +- my $serialized = freeze(sub { 42 }); +- my $code = thaw($serialized); +- $code->() == 42; ++ $safe->permit(qw(:default require)); ++ local $Storable::Deparse = 1; ++ local $Storable::Eval = sub { $safe->reval($_[0]) }; ++ my $serialized = freeze(sub { 42 }); ++ my $code = thaw($serialized); ++ $code->() == 42; + + =for example end + +diff --git a/Storable.xs b/Storable.xs +index e7d0329..83cd001 100644 +--- a/Storable.xs ++++ b/Storable.xs +@@ -1667,6 +1667,7 @@ static void free_context(pTHX_ stcxt_t *cxt) + + ASSERT(!cxt->s_dirty, ("clean context")); + ASSERT(prev, ("not freeing root context")); ++ assert(prev); + + SvREFCNT_dec(cxt->my_sv); + SET_STCXT(prev); +@@ -6677,6 +6678,7 @@ SV * obj + ALIAS: + net_mstore = 1 + CODE: ++ RETVAL = &PL_sv_undef; + if (!do_store(aTHX_ (PerlIO*) 0, obj, 0, ix, &RETVAL)) + RETVAL = &PL_sv_undef; + OUTPUT: diff --git a/SOURCES/Storable-2.56-CVE-2016-1238-avoid-loading-optional-modules-from.patch b/SOURCES/Storable-2.56-CVE-2016-1238-avoid-loading-optional-modules-from.patch new file mode 100644 index 0000000..d51fb3e --- /dev/null +++ b/SOURCES/Storable-2.56-CVE-2016-1238-avoid-loading-optional-modules-from.patch @@ -0,0 +1,18 @@ +diff -up Storable/Storable.pm.cve Storable/Storable.pm +--- Storable/Storable.pm.cve 2016-03-19 19:50:47.000000000 +0100 ++++ Storable/Storable.pm 2016-08-03 12:48:36.415082280 +0200 +@@ -25,7 +25,13 @@ use vars qw($canonical $forgive_me $VERS + $VERSION = '2.56'; + + BEGIN { +- if (eval { local $SIG{__DIE__}; require Log::Agent; 1 }) { ++ if (eval { ++ local $SIG{__DIE__}; ++ local @INC = @INC; ++ pop @INC if $INC[-1] eq '.'; ++ require Log::Agent; ++ 1; ++ }) { + Log::Agent->import; + } + # diff --git a/SPECS/perl-Storable.spec b/SPECS/perl-Storable.spec new file mode 100644 index 0000000..85550c4 --- /dev/null +++ b/SPECS/perl-Storable.spec @@ -0,0 +1,154 @@ +%{?scl:%scl_package perl-Storable} + +%global base_version 2.51 + +Name: %{?scl_prefix}perl-Storable +Epoch: 1 +Version: 2.56 +Release: 367%{?dist} +Summary: Persistence for Perl data structures +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/Storable/ +Source0: http://www.cpan.org/authors/id/A/AM/AMS/Storable-%{base_version}.tar.gz +# Unbundled from perl 5.21.11 +Patch0: Storable-2.51-Upgrade-to-2.53.patch +# Unbundled from perl 5.24.0 +Patch1: Storable-2.53-Upgrade-to-2.56.patch +# Avoid loading optional modules from default . (CVE-2016-1238) +Patch2: Storable-2.56-CVE-2016-1238-avoid-loading-optional-modules-from.patch +BuildRequires: %{?scl_prefix}perl +BuildRequires: %{?scl_prefix}perl-devel +BuildRequires: %{?scl_prefix}perl-generators +BuildRequires: %{?scl_prefix}perl(Config) +BuildRequires: %{?scl_prefix}perl(ExtUtils::MakeMaker) +# Run-time: +# Carp substitutes missing Log::Agent +BuildRequires: %{?scl_prefix}perl(Carp) +BuildRequires: %{?scl_prefix}perl(Exporter) +# Fcntl is optional, but locking is good +BuildRequires: %{?scl_prefix}perl(Fcntl) +BuildRequires: %{?scl_prefix}perl(IO::File) +# Log::Agent is optional +BuildRequires: %{?scl_prefix}perl(vars) +BuildRequires: %{?scl_prefix}perl(XSLoader) +# Tests: +BuildRequires: %{?scl_prefix}perl(bytes) +BuildRequires: %{?scl_prefix}perl(integer) +BuildRequires: %{?scl_prefix}perl(overload) +BuildRequires: %{?scl_prefix}perl(utf8) +BuildRequires: %{?scl_prefix}perl(Test::More) +BuildRequires: %{?scl_prefix}perl(threads) +BuildRequires: %{?scl_prefix}perl(Safe) +BuildRequires: %{?scl_prefix}perl(Scalar::Util) +BuildRequires: %{?scl_prefix}perl(strict) +BuildRequires: %{?scl_prefix}perl(warnings) +# Optional tests: +# Data::Dump not used +# Data::Dumper not used +BuildRequires: %{?scl_prefix}perl(B::Deparse) >= 0.61 +BuildRequires: %{?scl_prefix}perl(Digest::MD5) +BuildRequires: %{?scl_prefix}perl(File::Spec) >= 0.8 +BuildRequires: %{?scl_prefix}perl(Hash::Util) +BuildRequires: %{?scl_prefix}perl(Tie::Hash) +Requires: %{?scl_prefix}perl(:MODULE_COMPAT_%(%{?scl:scl enable %{scl} '}eval "$(perl -V:version)";echo $version%{?scl:'})) +# Carp substitutes missing Log::Agent +Requires: %{?scl_prefix}perl(Carp) +Requires: %{?scl_prefix}perl(Config) +# Fcntl is optional, but locking is good +Requires: %{?scl_prefix}perl(Fcntl) +Requires: %{?scl_prefix}perl(IO::File) + +%{?perl_default_filter} + +%description +The Storable package brings persistence to your Perl data structures +containing scalar, array, hash or reference objects, i.e. anything that +can be conveniently stored to disk and retrieved at a later time. + +%prep +%setup -q -n Storable-%{base_version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +# Remove bundled modules +rm -rf t/compat +sed -i -e '/^t\/compat\//d' MANIFEST + +%build +# Be ware hints/linux.pl removes "-ON" from CFLAGS if N > 2 because it can +# break the code. +%{?scl:scl enable %{scl} '}perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" && make %{?_smp_mflags}%{?scl:'} + +%install +%{?scl:scl enable %{scl} '}make pure_install DESTDIR=$RPM_BUILD_ROOT%{?scl:'} +find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \; +find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \; +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +%{?scl:scl enable %{scl} '}make test%{?scl:'} + +%files +%doc ChangeLog README +%{perl_vendorarch}/auto/* +%{perl_vendorarch}/Storable* +%{_mandir}/man3/* + +%changelog +* Wed Aug 03 2016 Jitka Plesnikova - 1:2.56-367 +- Avoid loading optional modules from default . (CVE-2016-1238) + +* Mon Jul 11 2016 Petr Pisar - 1:2.56-366 +- SCL + +* Sat May 14 2016 Jitka Plesnikova - 1:2.56-365 +- Increase release to favour standalone package + +* Wed May 11 2016 Jitka Plesnikova - 2.56-1 +- 2.56 bump in order to dual-live with perl 5.24 + +* Thu Feb 04 2016 Fedora Release Engineering - 1:2.53-347 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Thu Jun 18 2015 Fedora Release Engineering - 1:2.53-346 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Thu Jun 04 2015 Jitka Plesnikova - 1:2.53-345 +- Increase release to favour standalone package + +* Wed Jun 03 2015 Jitka Plesnikova - 1:2.53-2 +- Perl 5.22 rebuild + +* Wed May 06 2015 Petr Pisar - 1:2.53-1 +- 2.53 bump in order to dual-live with perl 5.22 + +* Wed Sep 03 2014 Jitka Plesnikova - 1:2.51-4 +- Increase Epoch to favour standalone package + +* Tue Aug 26 2014 Jitka Plesnikova - 2.51-3 +- Perl 5.20 rebuild + +* Sun Aug 17 2014 Fedora Release Engineering - 2.51-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Mon Jul 07 2014 Petr Pisar - 2.51-1 +- 2.51 bump + +* Sat Jun 07 2014 Fedora Release Engineering - 2.45-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Sun Aug 04 2013 Fedora Release Engineering - 2.45-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Mon Jul 15 2013 Petr Pisar - 2.45-1 +- 2.45 bump + +* Fri Jul 12 2013 Petr Pisar - 2.39-3 +- Link minimal build-root packages against libperl.so explicitly + +* Tue Jun 11 2013 Petr Pisar - 2.39-2 +- Do not export private libraries + +* Fri May 24 2013 Petr Pisar 2.39-1 +- Specfile autogenerated by cpanspec 1.78.