[perl] Clear $@ before `do' I/O error
Petr Pisar
ppisar at fedoraproject.org
Tue Sep 11 12:35:37 UTC 2012
commit d7a74399bfea032b893e0c62a7c409f87c640b88
Author: Petr Písař <ppisar at redhat.com>
Date: Tue Sep 11 10:32:13 2012 +0200
Clear $@ before `do' I/O error
...T-113730-should-be-cleared-on-do-IO-error.patch | 46 ++++++++++++++++++++
perl.spec | 5 ++
2 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch b/perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch
new file mode 100644
index 0000000..e08fde7
--- /dev/null
+++ b/perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch
@@ -0,0 +1,46 @@
+From a3ff80c12c16886edf9acdd3d172798e50defdb3 Mon Sep 17 00:00:00 2001
+From: Eric Brine <ikegami at adaelis.com>
+Date: Mon, 18 Jun 2012 14:56:32 -0400
+Subject: [PATCH] RT#113730 - $@ should be cleared on "do" IO error.
+
+---
+ pp_ctl.c | 1 +
+ t/op/do.t | 12 ++++++++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/pp_ctl.c b/pp_ctl.c
+index b414e81..437bc8f 100644
+--- a/pp_ctl.c
++++ b/pp_ctl.c
+@@ -3928,6 +3928,7 @@ PP(pp_require)
+ DIE(aTHX_ "Can't locate %s", name);
+ }
+
++ CLEAR_ERRSV();
+ RETPUSHUNDEF;
+ }
+ else
+diff --git a/t/op/do.t b/t/op/do.t
+index 93d3f73..c5a5905 100644
+--- a/t/op/do.t
++++ b/t/op/do.t
+@@ -286,4 +286,16 @@ SKIP: {
+ is($w, undef, 'do STRING does not propagate warning hints');
+ }
+
++# RT#113730 - $@ should be cleared on IO error.
++{
++ $@ = "should not see";
++ $! = 0;
++ my $rv = do("some nonexistent file");
++ my $saved_error = $@;
++ my $saved_errno = $!;
++ ok(!$rv, "do returns false on io errror");
++ ok(!$saved_error, "\$\@ not set on io error");
++ ok($saved_errno, "\$! set on io error");
++}
++
+ done_testing();
+--
+1.7.11.4
+
diff --git a/perl.spec b/perl.spec
index f12d2ab..308513b 100644
--- a/perl.spec
+++ b/perl.spec
@@ -93,6 +93,8 @@ Patch12: perl-5.16.1-PATCH-perl-114220-h-not-equiv-to-h.patch
# TODO Looks like it was fixed differently?
#Patch13: perl-5.14.2-locale-search-inc.patch
+# Clear $@ before `do' I/O error, rhbz#834226, RT#113730
+Patch13: perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch
# Update some of the bundled modules
@@ -1327,6 +1329,7 @@ tarball from perl.org.
%patch10 -p1
%patch11 -p1
%patch12 -p1
+%patch13 -p1
#copy the example script
cp -a %{SOURCE5} .
@@ -1531,6 +1534,7 @@ pushd %{build_archlib}/CORE/
'Fedora Patch10: Fix broken atof (RT#109318)' \
'Fedora Patch11: Do not access freed memory when cloning thread (RT#111610)' \
'Fedora Patch12: Match non-breakable space with /[\h]/ in ASCII mode (RT#114220)' \
+ 'Fedora Patch13: Clear $@ before "do" I/O error (RT#113730)' \
%{nil}
rm patchlevel.bak
@@ -2645,6 +2649,7 @@ sed \
* Tue Sep 11 2012 Petr Pisar <ppisar at redhat.com> - 4:5.16.1-233
- Do not access freed memory when cloning thread (bug #825749)
- Match non-breakable space with /[\h]/ in ASCII mode (bug #844919)
+- Clear $@ before `do' I/O error (bug #834226)
* Wed Sep 05 2012 Petr Pisar <ppisar at redhat.com> - 4:5.16.1-232
- Move App::Cpan from perl-Test-Harness to perl-CPAN (bug #854577)
More information about the scm-commits
mailing list