Skip to content

Commit de68b92

Browse files
authored
Extended CVE-2024-10224 patch and fixed ptests in perl-Module-ScanDeps. (#11218)
1 parent ec426a0 commit de68b92

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

SPECS/perl-Module-ScanDeps/CVE-2024-10224.patch

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,39 @@ index 7bc9662..dd79c65 100644
243243
# e.g. for autosplit .ix and .al files. In the latter case,
244244
# the key may also start with "./" if found via a relative path in @INC.
245245
$key =~ s|\\|/|g;
246+
247+
248+
From 49468814a24221affe113664899be21aef60e846 Mon Sep 17 00:00:00 2001
249+
From: rschupp <roderich.schupp@gmail.com>
250+
Date: Fri, 8 Nov 2024 19:17:30 +0100
251+
Subject: [PATCH] fix parsing of "use if ..."
252+
253+
Fixes errors in PAR::Packer test t/90-rt59710.t
254+
---
255+
lib/Module/ScanDeps.pm | 6 ++++--
256+
1 file changed, 4 insertions(+), 2 deletions(-)
257+
258+
diff --git a/lib/Module/ScanDeps.pm b/lib/Module/ScanDeps.pm
259+
index f911440..71d8b75 100644
260+
--- a/lib/Module/ScanDeps.pm
261+
+++ b/lib/Module/ScanDeps.pm
262+
@@ -925,7 +925,7 @@ sub scan_line {
263+
next CHUNK;
264+
}
265+
266+
- if (my ($pragma, $args) = /^use \s+ (autouse|if) \s+ (.+)/x)
267+
+ if (my ($pragma, $args) = /^(?:use|no) \s+ (autouse|if) \s+ (.+)/x)
268+
{
269+
# NOTE: There are different ways the MODULE may
270+
# be specified for the "autouse" and "if" pragmas, e.g.
271+
@@ -938,7 +938,9 @@ sub scan_line {
272+
else {
273+
# The syntax of the "if" pragma is
274+
# use if COND, MODULE => ARGUMENTS
275+
- (undef, $module) = _parse_module_list($args);
276+
+ # NOTE: This works only for simple conditions.
277+
+ $args =~ s/.*? (?:,|=>) \s*//x;
278+
+ ($module) = _parse_module_list($args);
279+
}
280+
$found{_mod2pm($pragma)}++;
281+
$found{_mod2pm($module)}++ if $module;

SPECS/perl-Module-ScanDeps/perl-Module-ScanDeps.spec

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Summary: Recursively scan Perl code for dependencies
33
Name: perl-Module-ScanDeps
44
Version: 1.35
5-
Release: 2%{?dist}
5+
Release: 3%{?dist}
66
License: GPL+ or Artistic
77
Group: Development/Libraries
88
Source0: https://cpan.metacpan.org/authors/id/R/RS/RSCHUPP/Module-ScanDeps-%{version}.tar.gz
@@ -15,10 +15,14 @@ BuildRequires: perl >= 5.28.0
1515
BuildRequires: perl(ExtUtils::MakeMaker)
1616
BuildRequires: perl-generators
1717
%if 0%{?with_check}
18+
BuildRequires: perl(AutoLoader)
19+
BuildRequires: perl(blib)
1820
BuildRequires: perl(CPAN)
1921
BuildRequires: perl(CPAN::Meta)
2022
BuildRequires: perl(FindBin)
23+
BuildRequires: perl(Test)
2124
BuildRequires: perl(Test::More)
25+
BuildRequires: perl(Test::Pod)
2226
%endif
2327

2428
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
@@ -55,6 +59,7 @@ find %{buildroot} -type f -name .packlist -exec rm -f {} +
5559
export PERL_MM_USE_DEFAULT=1
5660
cpan local::lib
5761
cpan Test::Requires
62+
cpan IPC::Run3
5863
make %{?_smp_mflags} test
5964

6065
%files
@@ -65,13 +70,16 @@ make %{?_smp_mflags} test
6570
%{_mandir}/man3/*
6671

6772
%changelog
73+
* Mon Nov 25 2024 Pawel Winogrodzki <pawelwi@microsoft.com> - 1.35-3
74+
- Fixing perl-Module-ScanDeps tests.
75+
6876
* Fri Nov 15 2024 Pawel Winogrodzki <pawelwi@microsoft.com> - 1.35-2
6977
- Patched CVE-2024-10224.
7078

7179
* Mon Dec 18 2023 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 1.35-1
7280
- Auto-upgrade to 1.35 - Azure Linux 3.0 - package upgrades
7381

74-
* Tue Aug 23 2020 Muhammad Falak <mwani@microsoft.com> - 1.31-2
82+
* Tue Aug 23 2022 Muhammad Falak <mwani@microsoft.com> - 1.31-2
7583
- Add BR on `perl-{(CPAN::*),(FindBin),(Test::More)}` to enable ptest
7684

7785
* Fri Apr 22 2022 Mateusz Malisz <mamalisz@microsoft.com> - 1.31-1

0 commit comments

Comments
 (0)