aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-04-11 08:10:54 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-04-11 08:10:54 +0000
commit028e9cc56f2e67335b87cfe5eea9dc1c584d8f6e (patch)
treee49a33fbf49ec42617db0aeb87ac6c3c2f908a79 /lib/ftp.c
parente0d8615eceacd52b2c619c503f133277fb371718 (diff)
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.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c5
1 files changed, 4 insertions, 1 deletions
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;
}