Bugzilla – Attachment 162499 Details for
Bug 35724
Define non-standard port numbers for SFTP upload/download in EDI accounts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35724: (QA follow-up) Also account for port in FTP
Bug-35724-QA-follow-up-Also-account-for-port-in-FT.patch (text/plain), 2.56 KB, created by
Martin Renvoize (ashimema)
on 2024-02-27 11:13:22 UTC
(
hide
)
Description:
Bug 35724: (QA follow-up) Also account for port in FTP
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-02-27 11:13:22 UTC
Size:
2.56 KB
patch
obsolete
>From 0c85cd2cc789e28fead3c526e137840e74103be4 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Tue, 27 Feb 2024 11:08:59 +0000 >Subject: [PATCH] Bug 35724: (QA follow-up) Also account for port in FTP > >We were only passing port into SFTP connections.. now that we allow >defining it, we should also pass it to FTP connections just in case >someone is still using those. > >This patch adds such functionality and defaults to port 21 in this case >when the port isn't defined. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Edifact/Transport.pm | 24 ++++++++++++++++-------- > 1 file changed, 16 insertions(+), 8 deletions(-) > >diff --git a/Koha/Edifact/Transport.pm b/Koha/Edifact/Transport.pm >index 80f6cc9ecf9..ebc5d801c87 100644 >--- a/Koha/Edifact/Transport.pm >+++ b/Koha/Edifact/Transport.pm >@@ -219,13 +219,17 @@ sub ftp_download { > > my $msg_hash = $self->message_hash(); > my @downloaded_files; >- my $ftp = Net::FTP->new( >+ my $port = $self->{account}->download_port ? $self->{account}->download_port : '21'; >+ my $ftp = Net::FTP->new( > $self->{account}->host, >+ Port => $port, > Timeout => 10, > Passive => 1 >- ) >- or return $self->_abort_download( undef, >- "Cannot connect to $self->{account}->host: $EVAL_ERROR" ); >+ ) >+ or return $self->_abort_download( >+ undef, >+ "Cannot connect to $self->{account}->host: $EVAL_ERROR" >+ ); > $ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex($self->{account}->password) ) > or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" ); > $ftp->cwd( $self->{account}->download_directory ) >@@ -260,13 +264,17 @@ sub ftp_download { > > sub ftp_upload { > my ( $self, @messages ) = @_; >- my $ftp = Net::FTP->new( >+ my $port = $self->{account}->upload_port ? $self->{account}->upload_port : '21'; >+ my $ftp = Net::FTP->new( > $self->{account}->host, >+ Port => $port, > Timeout => 10, > Passive => 1 >- ) >- or return $self->_abort_download( undef, >- "Cannot connect to $self->{account}->host: $EVAL_ERROR" ); >+ ) >+ or return $self->_abort_download( >+ undef, >+ "Cannot connect to $self->{account}->host: $EVAL_ERROR" >+ ); > $ftp->login( $self->{account}->username, Koha::Encryption->new->decrypt_hex($self->{account}->password) ) > or return $self->_abort_download( $ftp, "Cannot login: $ftp->message()" ); > $ftp->cwd( $self->{account}->upload_directory ) >-- >2.43.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35724
:
160644
|
160645
|
160646
|
160717
|
160718
|
160719
|
160720
|
162494
|
162495
|
162496
|
162497
|
162498
| 162499