]> granicus.if.org Git - curl/commitdiff
According to RFC959, CWD is supposed to return 250 on success, but
authorDaniel Stenberg <daniel@haxx.se>
Fri, 11 Apr 2003 08:10:54 +0000 (08:10 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 11 Apr 2003 08:10:54 +0000 (08:10 +0000)
 there seem to be non-compliant FTP servers out there that return 200,
 so we accept any '2xy' response now.

lib/ftp.c

index 22c27542cfceef90af7f0bc43f496c9cd78a197b..25806a45f62312fee99cfc80518659dc237f5a1d 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -726,7 +726,10 @@ CURLcode ftp_cwd(struct connectdata *conn, char *path)
   if (result)
     return result;
 
-  if (ftpcode != 250) {
+  /* According to RFC959, CWD is supposed to return 250 on success, but
+     there seem to be non-compliant FTP servers out there that return 200,
+     so we accept any '2xy' code here. */
+  if (ftpcode/100 != 2) {
     failf(conn->data, "Couldn't cd to %s", path);
     return CURLE_FTP_ACCESS_DENIED;
   }