aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/perl/perl-5.10.1/kfreebsd-filecopy-pipes.diff
diff options
context:
space:
mode:
authorRoman I Khimov <khimov@altell.ru>2010-09-20 16:22:21 +0400
committerRoman I Khimov <khimov@altell.ru>2010-09-23 09:49:26 +0400
commit5a52a7761eddaf8f83e7e8be27132df24d1196a9 (patch)
treec6cb61df2d73e2a91031592c0104bc12dd623bd1 /recipes/perl/perl-5.10.1/kfreebsd-filecopy-pipes.diff
parentef83636ae755045d8d740e9c3141dd394b0bb794 (diff)
downloadopenembedded-5a52a7761eddaf8f83e7e8be27132df24d1196a9.tar.gz
perl 5.10.1: update patches to Debian's 5.10.1-14
* Debian's source package changed its format in 5.10.1-10, so we can't just apply one patch as it was with initial 5.10.1 release. * fixes CVE-2010-1974 * fixes MD5 on ARM * fixes several other bugs (see changelog from http://packages.debian.org/source/sid/perl) Signed-off-by: Roman I Khimov <khimov@altell.ru>
Diffstat (limited to 'recipes/perl/perl-5.10.1/kfreebsd-filecopy-pipes.diff')
-rw-r--r--recipes/perl/perl-5.10.1/kfreebsd-filecopy-pipes.diff68
1 files changed, 68 insertions, 0 deletions
diff --git a/recipes/perl/perl-5.10.1/kfreebsd-filecopy-pipes.diff b/recipes/perl/perl-5.10.1/kfreebsd-filecopy-pipes.diff
new file mode 100644
index 0000000000..839d06465e
--- /dev/null
+++ b/recipes/perl/perl-5.10.1/kfreebsd-filecopy-pipes.diff
@@ -0,0 +1,68 @@
+From: Niko Tyni <ntyni@debian.org>
+Subject: Fix File::Copy::copy with pipes on GNU/kFreeBSD
+Bug-Debian: http://bugs.debian.org/537555
+Origin: upstream, http://perl5.git.perl.org/perl.git/commit/16f708c9bc0dc48713b200031295a40bed83bbfc
+
+Quoting Petr Salinger:
+The Copy tries to detect whether source and dest are the same files.
+Unfortunately, on the GNU/kFreeBSD the kernel returns for all pipes
+as device and inode numbers just zero. See pipe_stat() in
+http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/sys_pipe.c
+
+Patch by Petr Salinger, tests by Niko Tyni.
+
+Backported from blead change 16f708c9bc0dc48713b200031295a40bed83bbfc
+
+---
+ lib/File/Copy.pm | 2 +-
+ lib/File/Copy.t | 15 ++++++++++++++-
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm
+index e1d7724..1da5437 100644
+--- a/lib/File/Copy.pm
++++ b/lib/File/Copy.pm
+@@ -115,7 +115,7 @@ sub copy {
+ my @fs = stat($from);
+ if (@fs) {
+ my @ts = stat($to);
+- if (@ts && $fs[0] == $ts[0] && $fs[1] == $ts[1]) {
++ if (@ts && $fs[0] == $ts[0] && $fs[1] == $ts[1] && !-p $from) {
+ carp("'$from' and '$to' are identical (not copied)");
+ return 0;
+ }
+diff --git a/lib/File/Copy.t b/lib/File/Copy.t
+index bcfa207..2e5ce9c 100755
+--- a/lib/File/Copy.t
++++ b/lib/File/Copy.t
+@@ -14,7 +14,7 @@ use Test::More;
+
+ my $TB = Test::More->builder;
+
+-plan tests => 115;
++plan tests => 117;
+
+ # We're going to override rename() later on but Perl has to see an override
+ # at compile time to honor it.
+@@ -272,6 +272,19 @@ for my $cross_partition_test (0..1) {
+ }
+ }
+
++SKIP: {
++ skip("fork required to test pipe copying", 2)
++ if (!$Config{'d_fork'});
++
++ open(my $IN, "-|") || exec $^X, '-e', 'print "Hello, world!\n"';
++ open(my $OUT, "|-") || exec $^X, '-ne', 'exit(/Hello/ ? 55 : 0)';
++
++ ok(copy($IN, $OUT), "copy pipe to another");
++ close($OUT);
++ is($? >> 8, 55, "content copied through the pipes");
++ close($IN);
++}
++
+ END {
+ 1 while unlink "file-$$";
+ 1 while unlink "lib/file-$$";
+--
+tg: (daf8b46..) fixes/kfreebsd-filecopy-pipes (depends on: upstream)