From 0b61af1796fc572662a84618aec773d23fae86c3 Mon Sep 17 00:00:00 2001 From: zengwefeng Date: Fri, 29 Oct 2021 15:43:16 +0800 Subject: [PATCH] fix bug of quiting while source file increased --- lftp.spec | 12 +++++- quit-while-source-file-increased.patch | 57 ++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 quit-while-source-file-increased.patch diff --git a/lftp.spec b/lftp.spec index 4251c89..91cd85f 100644 --- a/lftp.spec +++ b/lftp.spec @@ -1,7 +1,7 @@ Summary: A sophisticated file transfer program Name: lftp Version: 4.9.1 -Release: 3 +Release: 4 License: GPLv3+ URL: http://lftp.yar.ru/ Source0: http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz @@ -9,7 +9,9 @@ BuildRequires: ncurses-devel, gnutls-devel, perl-generators, pkgconfig, gettext BuildRequires: gettext readline-devel, zlib-devel, gcc-c++ desktop-file-utils BuildRequires: chrpath Requires: %{name}-help -Patch1: lftp-4.0.9-date_fmt.patch + +Patch0: lftp-4.0.9-date_fmt.patch +Patch1: quit-while-source-file-increased.patch %description LFTP is a sophisticated file transfer program supporting a number of @@ -83,6 +85,12 @@ echo "%{_libdir}/lftp/%{version}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arc %changelog +* Fri Oct 29 2021 zengweifeng - 4.9.1-4 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:fix bug of quiting while source file increased + * Mon Nov 09 2020 quanhongfei - 4.9.1-3 - Type:requirement - ID:NA diff --git a/quit-while-source-file-increased.patch b/quit-while-source-file-increased.patch new file mode 100644 index 0000000..01c6cb5 --- /dev/null +++ b/quit-while-source-file-increased.patch @@ -0,0 +1,57 @@ +From 3cabbf03f80e78a69a0b9e797050a1dacf5c26da Mon Sep 17 00:00:00 2001 +From: sherlock2010 <15151851377@163.com> +Date: Thu, 28 Oct 2021 18:36:53 +0800 +Subject: [PATCH] Quit while source file increased + +--- + src/FileCopy.cc | 7 +++++++ + src/FileCopy.h | 1 + + 2 files changed, 8 insertions(+) + +diff --git a/src/FileCopy.cc b/src/FileCopy.cc +index ead65a2..361958e 100644 +--- a/src/FileCopy.cc ++++ b/src/FileCopy.cc +@@ -1137,6 +1137,7 @@ void FileCopyPeerFA::OpenSession() + debug((10,"copy dst: seek past eof (seek_pos=%lld, size=%lld)\n", + (long long)seek_pos,(long long)e_size)); + eof=true; ++ fileincreased=true; + if(date==NO_DATE || date==NO_DATE_YET) + return; + } +@@ -1284,6 +1285,11 @@ int FileCopyPeerFA::Put_LL(const char *buf,int len) + if(session->IsClosed()) + OpenSession(); + ++ if(fileincreased) ++ { ++ SetError(_("file size increased during transfer")); ++ return -1; ++ } + off_t io_at=pos; // GetRealPos can alter pos, save it. + if(GetRealPos()!=io_at) + return 0; +@@ -1352,6 +1358,7 @@ void FileCopyPeerFA::Init() + { + get_delay=0; + fxp=false; ++ fileincreased=false; + redirections=0; + can_seek=true; + can_seek0=true; +diff --git a/src/FileCopy.h b/src/FileCopy.h +index af97880..5a9e4cf 100644 +--- a/src/FileCopy.h ++++ b/src/FileCopy.h +@@ -335,6 +335,7 @@ class FileCopyPeerFA : public FileCopyPeer + FileSet info; + + bool fxp; // FXP (ftp<=>ftp copy) active ++ bool fileincreased; + + UploadState upload_state; + int redirections; +-- +1.8.3.1 +