aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/perl/perl/perl-fix-CVE-2016-1238.patch
blob: 730ef178adca10b3c133c162ab9b371a72986809 (plain)
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
From 9987be3d24286d96d9dccec0433253ee8ad894b4 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 21 Jun 2016 10:02:02 +1000
Subject: [PATCH] perl: fix CVE-2016-1238

(perl #127834) remove . from the end of @INC if complex modules are loaded

While currently Encode and Storable are know to attempt to load modules
not included in the core, updates to other modules may lead to those
also attempting to load new modules, so be safe and remove . for those
as well.

Backport patch from http://perl5.git.perl.org/perl.git/commitdiff/cee96d52c39b1e7b36e1c62d38bcd8d86e9a41ab

Upstream-Status: Backport
CVE: CVE-2016-1238
Signed-off-by: Mingli Yu <Mingli.Yu@windriver.com>
---
 cpan/Archive-Tar/bin/ptar                 | 1 +
 cpan/Archive-Tar/bin/ptardiff             | 1 +
 cpan/Archive-Tar/bin/ptargrep             | 1 +
 cpan/CPAN/scripts/cpan                    | 1 +
 cpan/Digest-SHA/shasum                    | 1 +
 cpan/Encode/bin/enc2xs                    | 1 +
 cpan/Encode/bin/encguess                  | 1 +
 cpan/Encode/bin/piconv                    | 1 +
 cpan/Encode/bin/ucmlint                   | 1 +
 cpan/Encode/bin/unidump                   | 1 +
 cpan/ExtUtils-MakeMaker/bin/instmodsh     | 1 +
 cpan/IO-Compress/bin/zipdetails           | 1 +
 cpan/JSON-PP/bin/json_pp                  | 1 +
 cpan/Test-Harness/bin/prove               | 1 +
 dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp | 1 +
 dist/Module-CoreList/corelist             | 1 +
 ext/Pod-Html/bin/pod2html                 | 1 +
 utils/c2ph.PL                             | 1 +
 utils/h2ph.PL                             | 2 ++
 utils/h2xs.PL                             | 2 ++
 utils/libnetcfg.PL                        | 1 +
 utils/perlbug.PL                          | 1 +
 utils/perldoc.PL                          | 5 ++++-
 utils/perlivp.PL                          | 2 ++
 utils/splain.PL                           | 6 ++++++
 25 files changed, 36 insertions(+), 1 deletion(-)

diff --git a/cpan/Archive-Tar/bin/ptar b/cpan/Archive-Tar/bin/ptar
index 0eaffa7..9dc6402 100644
--- a/cpan/Archive-Tar/bin/ptar
+++ b/cpan/Archive-Tar/bin/ptar
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 use strict;
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use File::Find;
 use Getopt::Std;
 use Archive::Tar;
diff --git a/cpan/Archive-Tar/bin/ptardiff b/cpan/Archive-Tar/bin/ptardiff
index 66bd859..4668fa6 100644
--- a/cpan/Archive-Tar/bin/ptardiff
+++ b/cpan/Archive-Tar/bin/ptardiff
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use Archive::Tar;
 use Getopt::Std;
diff --git a/cpan/Archive-Tar/bin/ptargrep b/cpan/Archive-Tar/bin/ptargrep
index 1a320f1..8dc6b4f 100644
--- a/cpan/Archive-Tar/bin/ptargrep
+++ b/cpan/Archive-Tar/bin/ptargrep
@@ -4,6 +4,7 @@
 # archive.  See 'ptargrep --help' for more documentation.
 #
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use warnings;
 
diff --git a/cpan/CPAN/scripts/cpan b/cpan/CPAN/scripts/cpan
index 5f4320e..ccba47e 100644
--- a/cpan/CPAN/scripts/cpan
+++ b/cpan/CPAN/scripts/cpan
@@ -1,5 +1,6 @@
 #!/usr/local/bin/perl
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use vars qw($VERSION);
 
diff --git a/cpan/Digest-SHA/shasum b/cpan/Digest-SHA/shasum
index 14ddd60..62a2b0e 100644
--- a/cpan/Digest-SHA/shasum
+++ b/cpan/Digest-SHA/shasum
@@ -13,6 +13,7 @@
 	## "-0" option for reading bit strings, and
 	## "-p" option for portable digests (to be deprecated).
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use warnings;
 use Fcntl;
diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
index 4d64e38..473a15c 100644
--- a/cpan/Encode/bin/enc2xs
+++ b/cpan/Encode/bin/enc2xs
@@ -4,6 +4,7 @@ BEGIN {
     # with $ENV{PERL_CORE} set
     # In case we need it in future...
     require Config; import Config;
+    pop @INC if $INC[-1] eq '.';
 }
 use strict;
 use warnings;
diff --git a/cpan/Encode/bin/encguess b/cpan/Encode/bin/encguess
index 5d7ac80..0be5c7c 100644
--- a/cpan/Encode/bin/encguess
+++ b/cpan/Encode/bin/encguess
@@ -1,5 +1,6 @@
 #!./perl
 use 5.008001;
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use warnings;
 use Encode;
diff --git a/cpan/Encode/bin/piconv b/cpan/Encode/bin/piconv
index c1dad9e..60b2a59 100644
--- a/cpan/Encode/bin/piconv
+++ b/cpan/Encode/bin/piconv
@@ -1,6 +1,7 @@
 #!./perl
 # $Id: piconv,v 2.7 2014/05/31 09:48:48 dankogai Exp $
 #
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use 5.8.0;
 use strict;
 use Encode ;
diff --git a/cpan/Encode/bin/ucmlint b/cpan/Encode/bin/ucmlint
index 622376d..25e0d67 100644
--- a/cpan/Encode/bin/ucmlint
+++ b/cpan/Encode/bin/ucmlint
@@ -3,6 +3,7 @@
 # $Id: ucmlint,v 2.2 2008/03/12 09:51:11 dankogai Exp $
 #
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 our  $VERSION = do { my @r = (q$Revision: 2.2 $ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r };
 
diff --git a/cpan/Encode/bin/unidump b/cpan/Encode/bin/unidump
index ae0da30..f190827 100644
--- a/cpan/Encode/bin/unidump
+++ b/cpan/Encode/bin/unidump
@@ -1,5 +1,6 @@
 #!./perl
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use Encode;
 use Getopt::Std;
diff --git a/cpan/ExtUtils-MakeMaker/bin/instmodsh b/cpan/ExtUtils-MakeMaker/bin/instmodsh
index e551434..b3b109f 100644
--- a/cpan/ExtUtils-MakeMaker/bin/instmodsh
+++ b/cpan/ExtUtils-MakeMaker/bin/instmodsh
@@ -1,5 +1,6 @@
 #!/usr/bin/perl -w
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use IO::File;
 use ExtUtils::Packlist;
diff --git a/cpan/IO-Compress/bin/zipdetails b/cpan/IO-Compress/bin/zipdetails
index 0249850..1b9c70a 100644
--- a/cpan/IO-Compress/bin/zipdetails
+++ b/cpan/IO-Compress/bin/zipdetails
@@ -5,6 +5,7 @@
 # Display info on the contents of a Zip file
 #
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use warnings ;
 
diff --git a/cpan/JSON-PP/bin/json_pp b/cpan/JSON-PP/bin/json_pp
index df9d243..896cd2f 100644
--- a/cpan/JSON-PP/bin/json_pp
+++ b/cpan/JSON-PP/bin/json_pp
@@ -1,5 +1,6 @@
 #!/usr/bin/perl
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use Getopt::Long;
 
diff --git a/cpan/Test-Harness/bin/prove b/cpan/Test-Harness/bin/prove
index 6637cc4..d71b238 100644
--- a/cpan/Test-Harness/bin/prove
+++ b/cpan/Test-Harness/bin/prove
@@ -1,5 +1,6 @@
 #!/usr/bin/perl -w
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use warnings;
 use App::Prove;
diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp b/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
index e2ac71a..d596cdf 100644
--- a/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
+++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
@@ -1,5 +1,6 @@
 #!perl
 use 5.006;
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 eval {
   require ExtUtils::ParseXS;
diff --git a/dist/Module-CoreList/corelist b/dist/Module-CoreList/corelist
index aa4a945..bbe61cc 100644
--- a/dist/Module-CoreList/corelist
+++ b/dist/Module-CoreList/corelist
@@ -130,6 +130,7 @@ requested perl versions.
 
 =cut
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use Module::CoreList;
 use Getopt::Long qw(:config no_ignore_case);
 use Pod::Usage;
diff --git a/ext/Pod-Html/bin/pod2html b/ext/Pod-Html/bin/pod2html
index b022859..7d1d232 100644
--- a/ext/Pod-Html/bin/pod2html
+++ b/ext/Pod-Html/bin/pod2html
@@ -216,6 +216,7 @@ This program is distributed under the Artistic License.
 
 =cut
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use Pod::Html;
 
 pod2html @ARGV;
diff --git a/utils/c2ph.PL b/utils/c2ph.PL
index 13389ec..cef0b5c 100644
--- a/utils/c2ph.PL
+++ b/utils/c2ph.PL
@@ -280,6 +280,7 @@ Anyway, here it is.  Should run on perl v4 or greater.  Maybe less.
 
 $RCSID = '$Id: c2ph,v 1.7 95/10/28 10:41:47 tchrist Exp Locker: tchrist $';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use File::Temp;
 
 ######################################################################
diff --git a/utils/h2ph.PL b/utils/h2ph.PL
index 55c1f72..300b756 100644
--- a/utils/h2ph.PL
+++ b/utils/h2ph.PL
@@ -36,6 +36,8 @@ $Config{startperl}
 
 print OUT <<'!NO!SUBS!';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
+
 use strict;
 
 use Config;
diff --git a/utils/h2xs.PL b/utils/h2xs.PL
index 268f680..f95ee0c 100644
--- a/utils/h2xs.PL
+++ b/utils/h2xs.PL
@@ -35,6 +35,8 @@ $Config{startperl}
 
 print OUT <<'!NO!SUBS!';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
+
 use warnings;
 
 =head1 NAME
diff --git a/utils/libnetcfg.PL b/utils/libnetcfg.PL
index 59a2de8..26d2f99 100644
--- a/utils/libnetcfg.PL
+++ b/utils/libnetcfg.PL
@@ -97,6 +97,7 @@ Jarkko Hietaniemi, conversion into libnetcfg for inclusion into Perl 5.8.
 
 # $Id: Configure,v 1.8 1997/03/04 09:22:32 gbarr Exp $
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use strict;
 use IO::File;
 use Getopt::Std;
diff --git a/utils/perlbug.PL b/utils/perlbug.PL
index 885785a..ae8c343 100644
--- a/utils/perlbug.PL
+++ b/utils/perlbug.PL
@@ -57,6 +57,7 @@ print OUT <<'!NO!SUBS!';
 my @patches = Config::local_patches();
 my $patch_tags = join "", map /(\S+)/ ? "+$1 " : (), @patches;
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
 use warnings;
 use strict;
 use Config;
diff --git a/utils/perldoc.PL b/utils/perldoc.PL
index e201de9..cd60bd4 100644
--- a/utils/perldoc.PL
+++ b/utils/perldoc.PL
@@ -44,7 +44,10 @@ $Config{startperl}
 # This "$file" file was generated by "$0"
 
 require 5;
-BEGIN { \$^W = 1 if \$ENV{'PERLDOCDEBUG'} }
+BEGIN {
+    \$^W = 1 if \$ENV{'PERLDOCDEBUG'};
+    pop \@INC if \$INC[-1] eq '.';
+}
 use Pod::Perldoc;
 exit( Pod::Perldoc->run() );
 
diff --git a/utils/perlivp.PL b/utils/perlivp.PL
index cc49f96..696a44e 100644
--- a/utils/perlivp.PL
+++ b/utils/perlivp.PL
@@ -39,6 +39,8 @@ print OUT "\n# perlivp $^V\n";
 
 print OUT <<'!NO!SUBS!';
 
+BEGIN { pop @INC if $INC[-1] eq '.' }
+
 sub usage {
     warn "@_\n" if @_;
     print << "    EOUSAGE";
diff --git a/utils/splain.PL b/utils/splain.PL
index 9c70b61..cae84a0 100644
--- a/utils/splain.PL
+++ b/utils/splain.PL
@@ -38,6 +38,12 @@ $Config{startperl}
 	if \$running_under_some_shell;
 !GROK!THIS!
 
+print <<'!NO!SUBS!';
+
+BEGIN { pop @INC if $INC[-1] eq '.' }
+
+!NO!SUBS!
+
 while (<IN>) {
     print OUT unless /^package diagnostics/;
 }
-- 
2.8.1