import lftp-4.8.4-2.el8

This commit is contained in:
CentOS Sources 2020-07-28 03:47:14 -04:00 committed by Stepan Oksanichenko
parent a1627776d9
commit 67e306dc17
2 changed files with 65 additions and 1 deletions

View File

@ -0,0 +1,59 @@
From 0ad0732b8fbacd3519b4e3ecf8c394681b314672 Mon Sep 17 00:00:00 2001
From: "Alexander V. Lukyanov" <lavv17f@gmail.com>
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 <config.h>
#include "SSH_Access.h"
#include "misc.h"
+#include <algorithm>
+#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);

View File

@ -1,7 +1,7 @@
Summary: A sophisticated file transfer program Summary: A sophisticated file transfer program
Name: lftp Name: lftp
Version: 4.8.4 Version: 4.8.4
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv3+ License: GPLv3+
Group: Applications/Internet Group: Applications/Internet
Source0: http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz Source0: http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz
@ -12,6 +12,7 @@ BuildRequires: zlib-devel
BuildRequires: desktop-file-utils BuildRequires: desktop-file-utils
Patch1: lftp-4.0.9-date_fmt.patch Patch1: lftp-4.0.9-date_fmt.patch
Patch2: lftp-4.8.4-ssh-prompt.patch
%description %description
LFTP is a sophisticated ftp/http file transfer program. Like bash, it has job 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 %setup -q
%patch1 -p1 -b .date_fmt %patch1 -p1 -b .date_fmt
%patch2 -p1 -b .ssh-prompt
#sed -i.rpath -e '/lftp_cv_openssl/s|-R.*lib||' configure #sed -i.rpath -e '/lftp_cv_openssl/s|-R.*lib||' configure
sed -i.norpath -e \ sed -i.norpath -e \
@ -101,6 +103,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Tue Apr 28 2020 Michal Ruprich <michalruprich@gmail.com> - 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 <mruprich@redhat.com> - 4.8.4-1 * Wed Aug 01 2018 Michal Ruprich <mruprich@redhat.com> - 4.8.4-1
- New version 4.8.4 - New version 4.8.4