From 68d811a3785e312a31d3df6293197031fe17dcf0 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Tue, 3 Nov 2020 06:59:20 -0500 Subject: [PATCH] import lftp-4.8.4-2.el8 --- SOURCES/lftp-4.8.4-ssh-prompt.patch | 59 +++++++++++++++++++++++++++++ SPECS/lftp.spec | 7 +++- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 SOURCES/lftp-4.8.4-ssh-prompt.patch diff --git a/SOURCES/lftp-4.8.4-ssh-prompt.patch b/SOURCES/lftp-4.8.4-ssh-prompt.patch new file mode 100644 index 0000000..6d3ba02 --- /dev/null +++ b/SOURCES/lftp-4.8.4-ssh-prompt.patch @@ -0,0 +1,59 @@ +From 0ad0732b8fbacd3519b4e3ecf8c394681b314672 Mon Sep 17 00:00:00 2001 +From: "Alexander V. Lukyanov" +Date: Thu, 5 Dec 2019 21:34:11 +0300 +Subject: [PATCH] SSH_Access: fixed yes/no/[fingerprint] recognition (fix #547, + fix #525) + +--- + src/SSH_Access.cc | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/SSH_Access.cc b/src/SSH_Access.cc +index 97683a3f..adf0c196 100644 +--- a/src/SSH_Access.cc ++++ b/src/SSH_Access.cc +@@ -20,6 +20,8 @@ + #include + #include "SSH_Access.h" + #include "misc.h" ++#include ++#include "ascii_ctype.h" + + void SSH_Access::MakePtyBuffers() + { +@@ -70,6 +70,26 @@ static bool IsPasswordPrompt(const char *b,const char *e) + return (e-b>=len && !strncasecmp(b,suffix,len)); + } + ++struct nocase_eq ++{ ++ inline bool operator() (char lhs, char rhs) const ++ { ++ return c_tolower(lhs) == c_tolower(rhs); ++ }; ++}; ++ ++static bool contains(char const *begin, char const *end, char const *needle) ++{ ++ return std::search(begin, end, needle, needle+strlen(needle), nocase_eq()) != end; ++} ++ ++static bool IsConfirmPrompt(const char *b,const char *e) ++{ ++ if(b==e) ++ return false; ++ return e[-1]=='?' && contains(b,e,"yes/no"); ++} ++ + int SSH_Access::HandleSSHMessage() + { + int m=STALL; +@@ -99,7 +106,7 @@ int SSH_Access::HandleSSHMessage() + password_sent++; + return m; + } +- if(ends_with(b,b+s,"(yes/no)?")) ++ if(IsConfirmPrompt(b,b+s)) + { + const char *answer=QueryBool("auto-confirm",hostname)?"yes\n":"no\n"; + pty_recv_buf->Put(answer); diff --git a/SPECS/lftp.spec b/SPECS/lftp.spec index d182ce1..bbd5126 100644 --- a/SPECS/lftp.spec +++ b/SPECS/lftp.spec @@ -1,7 +1,7 @@ Summary: A sophisticated file transfer program Name: lftp Version: 4.8.4 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv3+ Group: Applications/Internet Source0: http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz @@ -12,6 +12,7 @@ BuildRequires: zlib-devel BuildRequires: desktop-file-utils Patch1: lftp-4.0.9-date_fmt.patch +Patch2: lftp-4.8.4-ssh-prompt.patch %description LFTP is a sophisticated ftp/http file transfer program. Like bash, it has job @@ -32,6 +33,7 @@ Utility scripts for use with lftp. %setup -q %patch1 -p1 -b .date_fmt +%patch2 -p1 -b .ssh-prompt #sed -i.rpath -e '/lftp_cv_openssl/s|-R.*lib||' configure sed -i.norpath -e \ @@ -101,6 +103,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Tue Apr 28 2020 Michal Ruprich - 4.8.4-2 +- Resolves: #1793557 - SFTP over LFTP hangs if host key of the remote system doesn't exist + * Wed Aug 01 2018 Michal Ruprich - 4.8.4-1 - New version 4.8.4