]> granicus.if.org Git - curl/commitdiff
As reported in Mandrake's bug tracker bug 12285
authorDaniel Stenberg <daniel@haxx.se>
Mon, 29 Nov 2004 21:25:07 +0000 (21:25 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 29 Nov 2004 21:25:07 +0000 (21:25 +0000)
(http://qa.mandrakesoft.com/show_bug.cgi?id=12285), when connecting to an
IPv6 host with FTP, --disable-epsv (or --disable-eprt) effectively disables
the ability to transfer a file. Now, when connected to an FTP server with
IPv6, these FTP commands can't be disabled even if asked to with the
available libcurl options.

CHANGES
docs/libcurl/curl_easy_setopt.3
lib/ftp.c

diff --git a/CHANGES b/CHANGES
index fcec5e2a8b2e0503ac929450a45b164f222bb73b..8807b73387354f0f7e1fdc1537460455b042fa3d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,14 @@
 
                                   Changelog
 
+Daniel (29 November 2004)
+- As reported in Mandrake's bug tracker bug 12285
+  (http://qa.mandrakesoft.com/show_bug.cgi?id=12285), when connecting to an
+  IPv6 host with FTP, --disable-epsv (or --disable-eprt) effectively disables
+  the ability to transfer a file. Now, when connected to an FTP server with
+  IPv6, these FTP commands can't be disabled even if asked to with the
+  available libcurl options.
+
 Daniel (26 November 2004)
 - As reported in Mandrake's bug tracker bug 12289
   (http://qa.mandrakesoft.com/show_bug.cgi?id=12289), curl would print a
index e75ae4a2c04a31168d6c695fffe44b35b6782a48..0290d5b2ced3bcd780df3cc06d065537acc9dc37 100644 (file)
@@ -21,7 +21,7 @@
 .\" * $Id$
 .\" **************************************************************************
 .\"
-.TH curl_easy_setopt 3 "21 Nov 2004" "libcurl 7.12.3" "libcurl Manual"
+.TH curl_easy_setopt 3 "29 Nov 2004" "libcurl 7.12.3" "libcurl Manual"
 .SH NAME
 curl_easy_setopt - set options for a curl easy handle
 .SH SYNOPSIS
@@ -706,11 +706,15 @@ LPRT) command when doing active FTP downloads (which is enabled by
 \fICURLOPT_FTPPORT\fP). Using EPRT means that it will first attempt to use
 EPRT and then LPRT before using PORT, but if you pass FALSE (zero) to this
 option, it will not try using EPRT or LPRT, only plain PORT. (Added in 7.10.5)
+
+If the server is an IPv6 host, this option will have no effect as of 7.12.3.
 .IP CURLOPT_FTP_USE_EPSV
 Pass a long. If the value is non-zero, it tells curl to use the EPSV command
 when doing passive FTP downloads (which it always does by default). Using EPSV
 means that it will first attempt to use EPSV before using PASV, but if you
 pass FALSE (zero) to this option, it will not try using EPSV, only plain PASV.
+
+If the server is an IPv6 host, this option will have no effect as of 7.12.3.
 .IP CURLOPT_FTP_CREATE_MISSING_DIRS
 Pass a long. If the value is non-zero, curl will attempt to create any remote
 directory that it fails to CWD into. CWD is the command that changes working
index e33f4b38fc5843066f73d4e1b940ac8cde5ef0b3..47cb361aa113fcfb1297c9ddc97c606b8f435bea 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1184,6 +1184,16 @@ CURLcode ftp_use_port(struct connectdata *conn)
     return CURLE_FTP_PORT_FAILED;
   }
 
+#ifdef PF_INET6
+  if(!conn->bits.ftp_use_eprt &&
+     (conn->ip_addr->ai_family == PF_INET6)) {
+    /* EPRT is disabled but we are connected to a IPv6 host, so we ignore the
+       request! */
+    conn->bits.ftp_use_eprt = TRUE;
+  }
+#endif
+
+
   for (fcmd = EPRT; fcmd != DONE; fcmd++) {
     int lprtaf, eprtaf;
     int alen=0, plen=0;
@@ -1512,6 +1522,15 @@ CURLcode ftp_use_pasv(struct connectdata *conn,
   char newhost[48];
   char *newhostp=NULL;
 
+#ifdef PF_INET6
+  if(!conn->bits.ftp_use_epsv &&
+     (conn->ip_addr->ai_family == PF_INET6)) {
+    /* EPSV is disabled but we are connected to a IPv6 host, so we ignore the
+       request! */
+    conn->bits.ftp_use_epsv = TRUE;
+  }
+#endif
+
   for (modeoff = (conn->bits.ftp_use_epsv?0:1);
        mode[modeoff]; modeoff++) {
     result = Curl_ftpsendf(conn, "%s", mode[modeoff]);