diff options
author | Graham Barr <gbarr@pobox.com> | 2001-09-21 01:10:45 +0000 |
---|---|---|
committer | Graham Barr <gbarr@pobox.com> | 2001-09-21 01:10:45 +0000 |
commit | 091310e86dd1f0a0f9dd6f6ec2d5c17fac5ef254 (patch) | |
tree | 638da72f584494cca64d48037fbf32734fa2b80e | |
parent | 7406b8a57fd0d062ffdecbb4ece91d74510846b5 (diff) | |
download | perl-libnet-091310e86dd1f0a0f9dd6f6ec2d5c17fac5ef254.tar.gz |
Net::FTP
- use sysopen instead of open so we don't get caught by special chars in the filename
-rw-r--r-- | Net/FTP.pm | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -19,9 +19,10 @@ use IO::Socket; use Time::Local; use Net::Cmd; use Net::Config; +use Fcntl qw(O_WRONLY O_RDONLY O_APPEND O_CREAT O_TRUNC); # use AutoLoader qw(AUTOLOAD); -$VERSION = "2.58"; # $Id: //depot/libnet/Net/FTP.pm#57 $ +$VERSION = "2.58"; # $Id: //depot/libnet/Net/FTP.pm#58 $ @ISA = qw(Exporter Net::Cmd IO::Socket::INET); # Someday I will "use constant", when I am not bothered to much about @@ -448,7 +449,7 @@ sub get { $loc = \*FD; - unless(($where) ? open($loc,">>$local") : open($loc,">$local")) + unless(sysopen($loc, $local, O_CREAT | O_WRONLY | ($where ? O_APPEND : O_TRUNC))) { carp "Cannot open Local file $local: $!\n"; $data->abort; @@ -706,7 +707,7 @@ sub _store_cmd { $loc = \*FD; - unless(open($loc,"<$local")) + unless(sysopen($loc, $local, O_RDONLY)) { carp "Cannot open Local file $local: $!\n"; return undef; @@ -1717,6 +1718,6 @@ under the same terms as Perl itself. =for html <hr> -I<$Id: //depot/libnet/Net/FTP.pm#57 $> +I<$Id: //depot/libnet/Net/FTP.pm#58 $> =cut |