[open-ils-commits] [GIT] Evergreen ILS branch rel_2_10 updated. 5f6a1bb64afe8de6d286456fd1b45ea7760a8da1
Evergreen Git
git at git.evergreen-ils.org
Fri Mar 3 12:43:52 EST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".
The branch, rel_2_10 has been updated
via 5f6a1bb64afe8de6d286456fd1b45ea7760a8da1 (commit)
from edf891c6431208b15d4bfbc1f10563d525a44f1f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 5f6a1bb64afe8de6d286456fd1b45ea7760a8da1
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date: Fri Feb 24 18:04:29 2017 -0500
LP#1667835: avoid edi_fetcher.pl crash upon fetching zero-length file
This patch fixes an issue that could cause edi_fetcher.pl to crash
if the EDI partner supplies a zero-length file for Net::FTP to
download; such files are now skipped.
Testing would entail setting up an FTP server that contains a
zero-length file, then setting up an EDI remote account and
using edi_fetcher.pl to try to retrieve the file.
Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
Signed-off-by: Chris Sharp <csharp at georgialibraries.org>
Signed-off-by: Jason Stephenson <jason at sigio.com>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Utils/RemoteAccount.pm b/Open-ILS/src/perlmods/lib/OpenILS/Utils/RemoteAccount.pm
index 8c7682d..b4a8f1e 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Utils/RemoteAccount.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Utils/RemoteAccount.pm
@@ -605,6 +605,7 @@ sub get_ftp {
my $self = shift;
my $filename;
+ my $remote_filename = $self->{get_args}->[0];
eval { $filename = $self->_ftp->get(@{$self->{get_args}}) };
if ($@ or not $filename) {
$logger->error(
@@ -614,6 +615,16 @@ sub get_ftp {
);
return;
}
+ if (!defined(${$filename->sref})) {
+ # the underlying scalar is still undef, so Net::FTP must have
+ # successfully retrieved an empty file... which we should skip
+ $logger->error(
+ $self->_error(
+ "get $remote_filename from", $self->remote_host, ": remote file is zero-length"
+ )
+ );
+ return;
+ }
$self->local_file($filename);
$logger->info(
-----------------------------------------------------------------------
Summary of changes:
.../perlmods/lib/OpenILS/Utils/RemoteAccount.pm | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list