summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-11-29 21:07:00 +0000
committerChris 'BinGOs' Williams <chris@bingosnet.co.uk>2013-11-29 21:07:00 +0000
commit1818d3caff904c667c8db00213e74c3c5c6e3dd1 (patch)
tree9414a78b98e5054042f6c911b8edae03086ca7c9
parent68067e4e501e2ae1c0fb44558b6aa5c0a80a4143 (diff)
downloadperl-1818d3caff904c667c8db00213e74c3c5c6e3dd1.tar.gz
Update HTTP-Tiny to CPAN version 0.039
[DELTA] 0.039 2013-11-27 19:48:29 America/New_York [FIXED] - Temporary file creating during mirror() is now opened with O_EXCL for added security
-rwxr-xr-xPorting/Maintainers.pl2
-rw-r--r--cpan/HTTP-Tiny/lib/HTTP/Tiny.pm17
2 files changed, 13 insertions, 6 deletions
diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl
index c731d96a9f..4623248038 100755
--- a/Porting/Maintainers.pl
+++ b/Porting/Maintainers.pl
@@ -585,7 +585,7 @@ use File::Glob qw(:case);
},
'HTTP::Tiny' => {
- 'DISTRIBUTION' => 'DAGOLDEN/HTTP-Tiny-0.038.tar.gz',
+ 'DISTRIBUTION' => 'DAGOLDEN/HTTP-Tiny-0.039.tar.gz',
'FILES' => q[cpan/HTTP-Tiny],
'EXCLUDED' => [
't/00-compile.t',
diff --git a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
index 0178d65929..bb824c2eaa 100644
--- a/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
+++ b/cpan/HTTP-Tiny/lib/HTTP/Tiny.pm
@@ -3,7 +3,7 @@ package HTTP::Tiny;
use strict;
use warnings;
# ABSTRACT: A small, simple, correct HTTP/1.1 client
-our $VERSION = '0.038'; # VERSION
+our $VERSION = '0.039'; # VERSION
use Carp ();
@@ -113,13 +113,16 @@ sub mirror {
$args->{headers}{'if-modified-since'} ||= $self->_http_date($mtime);
}
my $tempfile = $file . int(rand(2**31));
- open my $fh, ">", $tempfile
- or Carp::croak(qq/Error: Could not open temporary file $tempfile for downloading: $!\n/);
+
+ require Fcntl;
+ sysopen my $fh, $tempfile, Fcntl::O_CREAT()|Fcntl::O_EXCL()|Fcntl::O_WRONLY()
+ or Carp::croak(qq/Error: Could not create temporary file $tempfile for downloading: $!\n/);
binmode $fh;
$args->{data_callback} = sub { print {$fh} $_[0] };
my $response = $self->request('GET', $url, $args);
close $fh
- or Carp::croak(qq/Error: Could not close temporary file $tempfile: $!\n/);
+ or Carp::croak(qq/Error: Caught error closing temporary file $tempfile: $!\n/);
+
if ( $response->{success} ) {
rename $tempfile, $file
or Carp::croak(qq/Error replacing $file with $tempfile: $!\n/);
@@ -1010,7 +1013,7 @@ HTTP::Tiny - A small, simple, correct HTTP/1.1 client
=head1 VERSION
-version 0.038
+version 0.039
=head1 SYNOPSIS
@@ -1609,6 +1612,10 @@ Mike Doherty <doherty@cpan.org>
=item *
+Petr Písař <ppisar@redhat.com>
+
+=item *
+
Serguei Trouchelle <stro@cpan.org>
=item *