File: 0001-Pre-load-PerlIO-scalar-before-loading-fatpacked-modu.patch

package info (click to toggle)
libobject-remote-perl 0.004001-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 516 kB
  • sloc: perl: 2,383; makefile: 10
file content (34 lines) | stat: -rw-r--r-- 1,134 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 9b014783658e3023ed4ce75a5b679161784638ab Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Tue, 25 Oct 2022 18:27:05 +0100
Subject: [PATCH] Pre-load PerlIO::scalar before loading fatpacked modules

This is just for robustness in case PerlIO::scalar or its dependencies
somehow get included in the fatpacked bundle. See the Debian bug for a
full story of how this could happen.

Bug-Debian: https://bugs.debian.org/1022780
Bug: https://rt.cpan.org/Ticket/Display.html?id=144942

---
 lib/Object/Remote/FatNode.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/Object/Remote/FatNode.pm b/lib/Object/Remote/FatNode.pm
index cafc47e..fbc0c21 100644
--- a/lib/Object/Remote/FatNode.pm
+++ b/lib/Object/Remote/FatNode.pm
@@ -111,6 +111,10 @@ my $end = stripspace <<'END_END';
     return;
   }
 
+  # pre-load PerlIO::scalar which we need for loading the fatpacked code
+  # just in case it or its dependencies got inadvertently bundled
+  open(my $fh, '<', \"1");
+
   unshift @INC, sub { load_from_hash(\%fatpacked, $_[1]) };
   push @INC, sub { load_from_hash(\%fatpacked_extra, $_[1]) };
 
-- 
2.37.2