diff options
Diffstat (limited to 'system/perl')
-rw-r--r-- | system/perl/APKBUILD | 61 | ||||
-rw-r--r-- | system/perl/cve-2023-31484.patch | 11 | ||||
-rw-r--r-- | system/perl/cve-2023-31486.patch | 84 | ||||
-rw-r--r-- | system/perl/fix-test-chris-williams-tcp-server.patch | 14 | ||||
-rw-r--r-- | system/perl/musl-locale.patch | 37 | ||||
-rw-r--r-- | system/perl/musl-stack-size.patch | 16 | ||||
-rw-r--r-- | system/perl/zlib-test.patch | 80 |
7 files changed, 287 insertions, 16 deletions
diff --git a/system/perl/APKBUILD b/system/perl/APKBUILD index b16bdfa56..9134c50b2 100644 --- a/system/perl/APKBUILD +++ b/system/perl/APKBUILD @@ -1,24 +1,38 @@ # Contributor: Leonardo Arena <rnalrd@alpinelinux.org> # Contributor: Valery Kartel <valery.kartel@gmail.com> -# Contributor: Kiyoshi Aman <kiyoshi.aman+adelie@gmail.com> +# Contributor: Síle Ekaterin Liszka <sheila@vulpine.house> # Maintainer: Adélie Perl Team <adelie-perl@lists.adelielinux.org> -# Proxy-For: solar pkgname=perl -pkgver=5.26.3 -pkgrel=0 +pkgver=5.34.3 +_glver=2.57 +_glauthor=JV +_glau=${_glauthor%%"${_glauthor#??}"} +_gla=${_glauthor%%"${_glauthor#?}"} +pkgrel=1 pkgdesc="Larry Wall's Practical Extraction and Report Language" url="https://www.perl.org/" arch="all" -license="Artistic-1.0-Perl GPL-2.0" -# remove !check when tests pass. -options="!check !fhs" +options="!fhs" +license="Artistic-1.0-Perl OR GPL-1.0+" depends="" makedepends="bzip2-dev zlib-dev" subpackages="$pkgname-doc $pkgname-dev" source="https://www.cpan.org/src/5.0/perl-$pkgver.tar.gz + musl-locale.patch + musl-stack-size.patch + zlib-test.patch + fix-test-chris-williams-tcp-server.patch + cve-2023-31484.patch + cve-2023-31486.patch + https://cpan.metacpan.org/authors/id/$_gla/$_glau/$_glauthor/Getopt-Long-$_glver.tar.gz " # secfixes: +# 5.34.3-r0: +# - CVE-2023-31484 +# - CVE-2023-31486 +# 5.34.1-r0: +# - CVE-2021-36770 # 5.26.3-r0: # - CVE-2018-12015 # - CVE-2018-18311 @@ -37,20 +51,21 @@ _archlib=/usr/lib/perl5/core_perl prepare() { chmod +w "$builddir"/*.c default_prepare - cd "$builddir" sed -e 's/less -R/less/g' \ -e 's/libswanted="\(.*\) nsl\(.*\)"/libswanted="\1\2"/g' \ - -i ./Configure || + -i ./Configure # Ensure that we never accidentally bundle zlib or bzip2 rm -rf cpan/Compress-Raw-Zlib/zlib-src rm -rf cpan/Compress-Raw-Bzip2/bzip2-src sed -i '/\(bzip2\|zlib\)-src/d' MANIFEST - + for i in lib t; do + rm -rf cpan/Getopt-Long/$i + cp -r "$srcdir"/Getopt-Long-$_glver/$i cpan/Getopt-Long + done } build() { - cd "$builddir" BUILD_ZLIB=0 BUILD_BZIP2=0 BZIP2_LIB=/usr/lib @@ -89,17 +104,25 @@ build() { } check() { - cd "$builddir" - make test + # https://perldoc.perl.org/perlhack.txt + export LC_ALL=C + export TEST_JOBS=${JOBS} + export PERL_TEST_HARNESS_ASAP=1 + make -j${JOBS} test_harness_notty } package() { - cd "$builddir" make DESTDIR="$pkgdir" install if [ -n "$(find $pkgdir/usr/local -type f)" ]; then error "files found under /usr/local" fi find "$pkgdir" -name '.*' -delete + + rm "$pkgdir"/usr/share/man/man1/prove.1 + rm "$pkgdir"/usr/share/man/man1/xsubpp.1 + rm -r "$pkgdir"/usr/share/man/man3 + + rm "$pkgdir"/usr/bin/xsubpp } dev() { @@ -110,10 +133,16 @@ dev() { mv "$pkgdir"/usr/bin/h2xs \ "$pkgdir"/usr/bin/perlivp \ "$pkgdir"/usr/bin/enc2xs \ - "$pkgdir"/usr/bin/xsubpp \ "$subpkgdir"/usr/bin/ default_dev } -sha512sums="03914ed51163c998a6afa45610a13cf50124a2c68d291c344b0d52fa15c27fc5d5d4f5dc117516078a03dfd51250097b87c8d5e2b17c7858a4c8c536aecd05af perl-5.26.3.tar.gz" +sha512sums="d3dcabec76e4d6854d6bc1b118cb30cb2baeb329f6deb9fbe4380d446568a2982c8fb242f257da94e743760d23bbad829a228cbe3a55a1c6f4636346e6ab1933 perl-5.34.3.tar.gz +a78b5fb1a2b6f60b401329cfd2d8349d4fdcc19628cde0e9b840b82e1a02e705f7d7413fe206aa13ed714ab93a65b62ac3d85dfd526ca8048621d5d89b22f0ef musl-locale.patch +c004d6612ec754e5947255a2e2d15b5581f187c32495aeeec9f4fa286919bd9f40c72b63db61e3f4004b09288af2063a6a14b67e5c289e9a8b23ebd7c216e16f musl-stack-size.patch +bbb2beb49604982c42c833b229852bc8bca4e3498f97fcfbb3bf7de10dddbef3b21c917f333958c64feb99a65f4093773e33018ae0e91dadeecdf985ab0ed3a2 zlib-test.patch +1cf3365942a6447083e7487e3b79e1a57d3b08dad9cadb86f44bdda3bd7882fe5d71ebb4fab12a0663d4c0d4c1566d593be10ea46ecf892926528a9ae31328b9 fix-test-chris-williams-tcp-server.patch +dd60c8db64f648a88aaaca0eb4e6cd4b29e9bf47f92cac54958c1d12573fe8181eb5da2144650c15da7f8e59a06243ac859ec57be5c0e5fd88fc7ec1b1982083 cve-2023-31484.patch +89195c2398196f1730b9dfc3adb87694007bb5f3b663d058056d323388e7858c8201aaddd733b1dbeaf4a5cc0989a39b78177897ee144c35ffb66bc30616eef4 cve-2023-31486.patch +6b07f683b6f1371bc7f9b018ec659c049d58de25194965c6e2ba3a288e6802ba07257aa5d447bc082f0481d0956798d9f17521faf6a31d896bb3be0d17953b49 Getopt-Long-2.57.tar.gz" diff --git a/system/perl/cve-2023-31484.patch b/system/perl/cve-2023-31484.patch new file mode 100644 index 000000000..8e2b71fea --- /dev/null +++ b/system/perl/cve-2023-31484.patch @@ -0,0 +1,11 @@ +diff '--color=auto' -Nurd perl-5.34.3/cpan/CPAN/lib/CPAN/HTTP/Client.pm perl-5.34.3.new/cpan/CPAN/lib/CPAN/HTTP/Client.pm +--- perl-5.34.3/cpan/CPAN/lib/CPAN/HTTP/Client.pm 2023-11-28 03:57:18.000000000 -0800 ++++ perl-5.34.3.new/cpan/CPAN/lib/CPAN/HTTP/Client.pm 2023-12-01 20:31:22.921302476 -0800 +@@ -32,6 +32,7 @@ + + my $want_proxy = $self->_want_proxy($uri); + my $http = HTTP::Tiny->new( ++ verify_SSL => 1, + $want_proxy ? (proxy => $self->{proxy}) : () + ); + diff --git a/system/perl/cve-2023-31486.patch b/system/perl/cve-2023-31486.patch new file mode 100644 index 000000000..fe7689447 --- /dev/null +++ b/system/perl/cve-2023-31486.patch @@ -0,0 +1,84 @@ +From 1490431e40e22052f75a0b3449f1f53cbd27ba92 Mon Sep 17 00:00:00 2001 +From: Dominic Hargreaves <dom@earth.li> +Date: Thu, 21 May 2020 22:53:37 +0100 +Subject: [PATCH] Enable SSL by default in HTTP::Tiny + +Gbp-Pq: Topic debian +Gbp-Pq: Name http-tiny-ssl.diff +--- + cpan/HTTP-Tiny/lib/HTTP/Tiny.pm | 20 +++++++++----------- + 1 file changed, 9 insertions(+), 11 deletions(-) + +diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm +index 5803e4599..88ba51461 100644 +--- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm ++++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm +@@ -40,7 +40,7 @@ sub _croak { require Carp; Carp::croak(@_) } + #pod * C<timeout> — Request timeout in seconds (default is 60) If a socket open, + #pod read or write takes longer than the timeout, an exception is thrown. + #pod * C<verify_SSL> — A boolean that indicates whether to validate the SSL +-#pod certificate of an C<https> — connection (default is false) ++#pod certificate of an C<https> — connection (default is true) + #pod * C<SSL_options> — A hashref of C<SSL_*> — options to pass through to + #pod L<IO::Socket::SSL> + #pod +@@ -112,7 +112,7 @@ sub new { + max_redirect => 5, + timeout => defined $args{timeout} ? $args{timeout} : 60, + keep_alive => 1, +- verify_SSL => $args{verify_SSL} || $args{verify_ssl} || 0, # no verification by default ++ verify_SSL => $args{verify_SSL} // $args{verify_ssl} // 1, # verification by default + no_proxy => $ENV{no_proxy}, + }; + +@@ -1038,7 +1038,7 @@ sub new { + timeout => 60, + max_line_size => 16384, + max_header_lines => 64, +- verify_SSL => 0, ++ verify_SSL => 1, + SSL_options => {}, + %args + }, $class; +@@ -1765,7 +1765,7 @@ C<timeout> — Request timeout in seconds (default is 60) If a socket open, read + + =item * + +-C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is false) ++C<verify_SSL> — A boolean that indicates whether to validate the SSL certificate of an C<https> — connection (default is true) + + =item * + +@@ -2035,7 +2035,7 @@ Verification of server identity + + =back + +-B<By default, HTTP::Tiny does not verify server identity>. ++B<By default, HTTP::Tiny verifies server identity. + + Server identity verification is controversial and potentially tricky because it + depends on a (usually paid) third-party Certificate Authority (CA) trust model +@@ -2043,16 +2043,14 @@ to validate a certificate as legitimate. This discriminates against servers + with self-signed certificates or certificates signed by free, community-driven + CA's such as L<CAcert.org|http://cacert.org>. + +-By default, HTTP::Tiny does not make any assumptions about your trust model, +-threat level or risk tolerance. It just aims to give you an encrypted channel +-when you need one. +- + Setting the C<verify_SSL> attribute to a true value will make HTTP::Tiny verify + that an SSL connection has a valid SSL certificate corresponding to the host + name of the connection and that the SSL certificate has been verified by a CA. + Assuming you trust the CA, this will protect against a L<man-in-the-middle +-attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>. If you are +-concerned about security, you should enable this option. ++attack|http://en.wikipedia.org/wiki/Man-in-the-middle_attack>. ++ ++If you are not concerned about security, and this default causes problems, ++you should disable this option. + + Certificate verification requires a file containing trusted CA certificates. + +-- +GitLab + diff --git a/system/perl/fix-test-chris-williams-tcp-server.patch b/system/perl/fix-test-chris-williams-tcp-server.patch new file mode 100644 index 000000000..bc932924c --- /dev/null +++ b/system/perl/fix-test-chris-williams-tcp-server.patch @@ -0,0 +1,14 @@ +diff -ur a/cpan/IO-Socket-IP/t/31nonblocking-connect-internet.t b/cpan/IO-Socket-IP/t/31nonblocking-connect-internet.t +--- a/cpan/IO-Socket-IP/t/31nonblocking-connect-internet.t 2023-02-08 14:44:25.658759177 -0600 ++++ b/cpan/IO-Socket-IP/t/31nonblocking-connect-internet.t 2023-02-08 14:45:27.444140680 -0600 +@@ -11,8 +11,8 @@ + use IO::Socket::INET; + use Errno qw( EINPROGRESS EWOULDBLOCK ECONNREFUSED ); + +-# Chris Williams (BINGOS) has offered cpanidx.org as a TCP testing server here +-my $test_host = "cpanidx.org"; ++# Chris Williams' server was not accessible 2023-02-* ++my $test_host = "www.adelielinux.org"; + my $test_good_port = 80; + my $test_bad_port = 6666; + diff --git a/system/perl/musl-locale.patch b/system/perl/musl-locale.patch new file mode 100644 index 000000000..65839f1fe --- /dev/null +++ b/system/perl/musl-locale.patch @@ -0,0 +1,37 @@ +diff --git a/locale.c b/locale.c +index 7653340..7243cb1 100644 +--- a/locale.c ++++ b/locale.c +@@ -581,6 +581,10 @@ S_emulate_setlocale(const int category, + + return (char *) querylocale(mask, cur_obj); + ++# elif defined(_NL_LOCALE_NAME) ++ ++ return (char *) nl_langinfo_l(_NL_LOCALE_NAME(category), cur_obj); ++ + # else + + /* If this assert fails, adjust the size of curlocales in intrpvar.h */ +@@ -737,7 +741,7 @@ S_emulate_setlocale(const int category, + + /* Here, we are switching locales. */ + +-# ifndef HAS_QUERYLOCALE ++# if !defined(HAS_QUERYLOCALE) && !defined(_NL_LOCALE_NAME) + + if (strEQ(locale, "")) { + +@@ -1094,6 +1098,12 @@ S_emulate_setlocale(const int category, + locale = querylocale(mask, new_obj); + } + ++# elif defined(_NL_LOCALE_NAME) ++ ++ if (strEQ(locale, "")) { ++ locale = nl_langinfo_l(_NL_LOCALE_NAME(category), new_obj); ++ } ++ + # else + + /* Here, 'locale' is the return value */ diff --git a/system/perl/musl-stack-size.patch b/system/perl/musl-stack-size.patch new file mode 100644 index 000000000..08a9ef0e8 --- /dev/null +++ b/system/perl/musl-stack-size.patch @@ -0,0 +1,16 @@ +Tests fails on s390x due to low thread stack size +upstream report: https://github.com/Perl/perl5/issues/18160 + +diff --git a/t/thread_it.pl b/t/thread_it.pl +index f38a580..e8c450a 100644 +--- a/t/thread_it.pl ++++ b/t/thread_it.pl +@@ -36,7 +36,7 @@ my $curr = threads->create({ + stack_size => $^O eq 'hpux' ? 524288 : + $^O eq 'darwin' ? 2000000: + $^O eq 'VMS' ? 150000 : +- $^O eq 'aix' ? 1500000 : 0, ++ $^O eq 'aix' ? 1500000 : 256*1024, + }, sub { + run_tests(); + return defined &curr_test ? curr_test() : () diff --git a/system/perl/zlib-test.patch b/system/perl/zlib-test.patch new file mode 100644 index 000000000..1cb8f5e80 --- /dev/null +++ b/system/perl/zlib-test.patch @@ -0,0 +1,80 @@ +diff --git a/cpan/Compress-Raw-Zlib/t/02zlib.t b/cpan/Compress-Raw-Zlib/t/02zlib.t +index 64c8944..9b2e9cb 100644 +--- a/cpan/Compress-Raw-Zlib/t/02zlib.t ++++ b/cpan/Compress-Raw-Zlib/t/02zlib.t +@@ -13,6 +13,7 @@ use bytes; + use Test::More ; + use CompTestUtils; + ++use constant ZLIB_1_2_12_0 => 0x12C0; + + BEGIN + { +@@ -490,7 +491,16 @@ SKIP: + last if $status == Z_STREAM_END or $status != Z_OK ; + } + +- cmp_ok $status, '==', Z_DATA_ERROR ; ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + is $GOT, $goodbye ; + + +@@ -514,7 +524,17 @@ SKIP: + is length($rest), $len2, "expected compressed output"; + + $GOT = ''; +- cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR, "inflate returns Z_DATA_ERROR"; ++ $status = $k->inflate($rest, $GOT); ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + is $GOT, $goodbye ; + } + +diff --git a/cpan/IO-Compress/t/cz-03zlib-v1.t b/cpan/IO-Compress/t/cz-03zlib-v1.t +index 9b75f9b..41734d0 100644 +--- a/cpan/IO-Compress/t/cz-03zlib-v1.t ++++ b/cpan/IO-Compress/t/cz-03zlib-v1.t +@@ -14,6 +14,8 @@ use Test::More ; + use CompTestUtils; + use Symbol; + ++use constant ZLIB_1_2_12_0 => 0x12C0; ++ + BEGIN + { + # use Test::NoWarnings, if available +@@ -700,7 +702,16 @@ EOM + + ($GOT, $status) = $k->inflate($rest) ; + +- ok $status == Z_DATA_ERROR ; ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + ok $Z . $GOT eq $goodbye ; + } + |