public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Kamil Dudka <kdudka@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/curl] curl-v8.23.0-3: prevent FTP server from hanging on closed data connection (#643656)
Date: Tue, 03 Nov 2026 12:34:16 GMT	[thread overview]
Message-ID: <179370925694.1.11006034116605926013.rpms-curl-3ae3f6ea1951@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/curl
Branch : curl-v8.23.0-3
Commit : 3ae3f6ea195177fd55e16a6c2c8531d65eadc721
Author : Kamil Dudka <kdudka@redhat.com>
Date   : 2010-10-29T12:21:37+02:00
Stats  : +125/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/curl/c/3ae3f6ea195177fd55e16a6c2c8531d65eadc721?branch=curl-v8.23.0-3

Log:
prevent FTP server from hanging on closed data connection (#643656)

---
diff --git a/0001-curl-7.21.2-0c8e5f7.patch b/0001-curl-7.21.2-0c8e5f7.patch
new file mode 100644
index 0000000..ec59ed4
--- /dev/null
+++ b/0001-curl-7.21.2-0c8e5f7.patch
@@ -0,0 +1,115 @@
+ CHANGES             |   10 ++++++++++
+ lib/ftp.c           |    7 ++++++-
+ tests/data/test1036 |    1 +
+ tests/data/test1057 |    1 +
+ tests/data/test110  |    1 +
+ tests/data/test122  |    1 +
+ tests/data/test135  |    1 +
+ 7 files changed, 21 insertions(+), 1 deletions(-)
+
+diff --git a/CHANGES b/CHANGES
+index c06d213..90ef831 100644
+--- a/CHANGES
++++ b/CHANGES
+@@ -6,6 +6,16 @@
+ 
+                                   Changelog
+ 
++Kamil Dudka (29 Oct 2010)
++- ftp: prevent server from hanging on closed data connection
++  
++  Some FTP servers (e.g. Pure-ftpd) end up hanging if we close the data
++  connection before transferring all the requested data.  If we send ABOR
++  in that case, it prevents the server from hanging.
++  
++  Bug: https://bugzilla.redhat.com/643656
++  Reported by: Pasi Karkkainen, Patrick Monnerat
++
+ Version 7.21.2 (12 Oct 2010)
+ 
+ Daniel Stenberg (12 Oct 2010)
+diff --git a/lib/ftp.c b/lib/ftp.c
+index 60d9517..b11be35 100644
+--- a/lib/ftp.c
++++ b/lib/ftp.c
+@@ -3083,6 +3083,11 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
+ #endif
+ 
+   if(conn->sock[SECONDARYSOCKET] != CURL_SOCKET_BAD) {
++    if(!result && ftpc->dont_check)
++      /* prevent some FTP servers (namely Pure-ftpd) from hanging if we close
++       * the data channel before transferring all data */
++      result = Curl_pp_sendf(&ftpc->pp, "ABOR");
++
+     if(conn->ssl[SECONDARYSOCKET].use) {
+       /* The secondary socket is using SSL so we must close down that part
+          first before we close the socket for real */
+@@ -3097,7 +3102,7 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status,
+     }
+   }
+ 
+-  if((ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid &&
++  if(!result && (ftp->transfer == FTPTRANSFER_BODY) && ftpc->ctl_valid &&
+      pp->pending_resp && !premature) {
+     /*
+      * Let's see what the server says about the transfer we just performed,
+diff --git a/tests/data/test1036 b/tests/data/test1036
+index b8ebc4f..a31cb45 100644
+--- a/tests/data/test1036
++++ b/tests/data/test1036
+@@ -50,6 +50,7 @@ TYPE I
+ SIZE 1036
+ REST 20
+ RETR 1036
++ABOR
+ QUIT
+ </protocol>
+ <file name="log/curl1036.out">
+diff --git a/tests/data/test1057 b/tests/data/test1057
+index cfb88f2..b4ef20c 100644
+--- a/tests/data/test1057
++++ b/tests/data/test1057
+@@ -45,6 +45,7 @@ TYPE I
+ SIZE 1057
+ REST 52
+ RETR 1057
++ABOR
+ QUIT
+ </protocol>
+ </verify>
+diff --git a/tests/data/test110 b/tests/data/test110
+index b63ba8a..4a094e7 100644
+--- a/tests/data/test110
++++ b/tests/data/test110
+@@ -46,6 +46,7 @@ TYPE I
+ SIZE 110
+ REST 20
+ RETR 110
++ABOR
+ QUIT
+ </protocol>
+ </verify>
+diff --git a/tests/data/test122 b/tests/data/test122
+index fb1dd05..ac60672 100644
+--- a/tests/data/test122
++++ b/tests/data/test122
+@@ -39,6 +39,7 @@ EPSV
+ PASV
+ TYPE I
+ SIZE 122
++ABOR
+ QUIT
+ </protocol>
+ </verify>
+diff --git a/tests/data/test135 b/tests/data/test135
+index a051dba..10eb0ea 100644
+--- a/tests/data/test135
++++ b/tests/data/test135
+@@ -47,6 +47,7 @@ TYPE I
+ SIZE 135
+ REST 4
+ RETR 135
++ABOR
+ QUIT
+ </protocol>
+ </verify>

diff --git a/curl.spec b/curl.spec
index 512a5f1..62e2d1a 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,13 +1,16 @@
 Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
 Name: curl
 Version: 7.21.2
-Release: 2%{?dist}
+Release: 3%{?dist}
 License: MIT
 Group: Applications/Internet
 Source: http://curl.haxx.se/download/%{name}-%{version}.tar.lzma
 Source2: curlbuild.h
 Source3: hide_selinux.c
 
+# ftp: prevent server from hanging on closed data connection (#643656)
+Patch1: 0001-curl-7.21.2-0c8e5f7.patch
+
 # patch making libcurl multilib ready
 Patch101: 0101-curl-7.21.1-multilib.patch
 
@@ -103,6 +106,9 @@ for f in CHANGES README; do
     mv -f ${f}.utf8 ${f}
 done
 
+# upstream patches (already applied)
+%patch1 -p1
+
 # Fedora patches
 %patch101 -p1
 %patch102 -p1
@@ -223,6 +229,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/aclocal/libcurl.m4
 
 %changelog
+* Fri Oct 29 2010 Kamil Dudka <kdudka@redhat.com> 7.21.2-3
+- prevent FTP server from hanging on closed data connection (#643656)
+
 * Thu Oct 14 2010 Paul Howarth <paul@city-fan.org> 7.21.2-2
 - enforce versioned libssh2 dependency for libcurl (#642796)
 

                 reply	other threads:[~2026-11-03 12:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179370925694.1.11006034116605926013.rpms-curl-3ae3f6ea1951@fedoraproject.org \
    --to=kdudka@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox