From 028e9cc56f2e67335b87cfe5eea9dc1c584d8f6e Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 11 Apr 2003 08:10:54 +0000 Subject: 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' response now. --- lib/ftp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/ftp.c b/lib/ftp.c index 22c27542c..25806a45f 100644 --- 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; } -- cgit v1.2.3