[open-ils-commits] [GIT] Evergreen ILS branch master updated. a3d1b7c215d2a7f5c14c0e013a3dfcae8dfe150d

Evergreen Git git at git.evergreen-ils.org
Fri Mar 3 12:42:57 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, master has been updated
       via  a3d1b7c215d2a7f5c14c0e013a3dfcae8dfe150d (commit)
      from  7dae4c2435a9fd9664ecd6c339b0a7e2d62edc28 (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 a3d1b7c215d2a7f5c14c0e013a3dfcae8dfe150d
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