From 6c76cb8ff3bfe4cb6dac686bc2b88507d1309fed Mon Sep 17 00:00:00 2001 From: sherlock2010 <15151851377@163.com> Date: Thu, 28 Oct 2021 18:55:15 +0800 Subject: [PATCH] Quit while source file increased --- Quit-while-source-file-increased.patch | 57 ++++++++++++++++++++++++++ lftp.spec | 11 ++++- 2 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 Quit-while-source-file-increased.patch 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 + diff --git a/lftp.spec b/lftp.spec index 3f6dbcd..f42e547 100644 --- a/lftp.spec +++ b/lftp.spec @@ -1,7 +1,7 @@ Summary: A sophisticated file transfer program Name: lftp Version: 4.9.2 -Release: 1 +Release: 2 License: GPLv3+ URL: http://lftp.yar.ru/ Source0: http://lftp.yar.ru/ftp/%{name}-%{version}.tar.xz @@ -9,7 +9,8 @@ BuildRequires: ncurses-devel, gnutls-devel, perl-generators, pkgconfig, gettext BuildRequires: gettext readline-devel, zlib-devel, gcc-c++ desktop-file-utils BuildRequires: chrpath -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 +84,12 @@ echo "%{_libdir}/lftp/%{version}" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arc %changelog +* Thu Oct 28 2021 zhouyihang - 4.9.2-2 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: quit while source file increased + * Fri Jan 29 2021 xihaochen - 4.9.2-1 - Type:requirements - Id:NA