]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
ftp: accept all 2xx responses to the PORT command
authorPatrick Monnerat <pm@datasphere.ch>
Wed, 11 Feb 2015 18:51:57 +0000 (19:51 +0100)
committerPatrick Monnerat <pm@datasphere.ch>
Wed, 11 Feb 2015 18:51:57 +0000 (19:51 +0100)
lib/ftp.c

index 68610f95867d4392506453925d51da7fda118045..5aa617edd020783c619c2e95d78984f50a0dbcf5 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2102,7 +2102,9 @@ static CURLcode ftp_state_port_resp(struct connectdata *conn,
   ftpport fcmd = (ftpport)ftpc->count1;
   CURLcode result = CURLE_OK;
 
-  if(ftpcode != 200) {
+  /* The FTP spec tells a positive response should have code 200.
+     Be more permissive here to tolerate deviant servers. */
+  if(ftpcode / 100 != 2) {
     /* the command failed */
 
     if(EPRT == fcmd) {