From 90244813fe8110fc91f3746ebd93880e1c911cf1 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 27 Jan 2015 12:27:50 +0800 Subject: Bug 1124432: Backport upstream bug 1079065 to bmo/4.2 to fix improper use of open() calls --- Bugzilla/PatchReader/AddCVSContext.pm | 2 +- Bugzilla/PatchReader/Raw.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'Bugzilla/PatchReader') diff --git a/Bugzilla/PatchReader/AddCVSContext.pm b/Bugzilla/PatchReader/AddCVSContext.pm index 910e45669..e4100afb1 100644 --- a/Bugzilla/PatchReader/AddCVSContext.pm +++ b/Bugzilla/PatchReader/AddCVSContext.pm @@ -190,7 +190,7 @@ sub push_context_lines { if (Bugzilla::PatchReader::CVSClient::cvs_co_rev($this->{CVSROOT}, $this->{REVISION}, $this->{FILENAME})) { die "Could not check out $this->{FILENAME} r$this->{REVISION} from $this->{CVSROOT}"; } - open my $fh, $this->{FILENAME} or die "Could not open $this->{FILENAME}"; + open(my $fh, '<', $this->{FILENAME}) or die "Could not open $this->{FILENAME}"; $this->{FILE} = $fh; $this->{NEXT_FILE_LINE} = 1; trick_taint($olddir); # $olddir comes from getcwd() diff --git a/Bugzilla/PatchReader/Raw.pm b/Bugzilla/PatchReader/Raw.pm index b58ed3a2d..7e34bd4bf 100644 --- a/Bugzilla/PatchReader/Raw.pm +++ b/Bugzilla/PatchReader/Raw.pm @@ -234,7 +234,7 @@ sub iterate_file { my $this = shift; my ($filename) = @_; - open FILE, $filename or die "Could not open $filename: $!"; + open(FILE, '<', $filename) or die "Could not open $filename: $!"; $this->start_lines($filename); while () { $this->next_line($_); -- cgit v1.2.3-24-g4f1b