summaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorMichael Heimpold <mhei@heimpold.de>2022-08-24 18:58:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2022-09-07 10:26:55 +0200
commitd6686856577c373e06adeb8eb4e34e2e046e194d (patch)
tree33326debee3f040fcb425988f1b93eeb99e96e8c /lib/ftp.c
parentf703cf971ccdb93fea05f223cabbb99ca06cdc75 (diff)
downloadcurl-d6686856577c373e06adeb8eb4e34e2e046e194d.tar.gz
ftp: ignore a 550 response to MDTM
The 550 is overused as a return code for multiple error case, e.g. file not found and/or insufficient permissions to access the file. So we cannot fail hard in this case. Adjust test 511 since we now fail later. Add new test 3027 which check that when MDTM failed, but the file could actually be retrieved, that in this case no filetime is provided. Reported-by: Michael Heimpold Fixes #9357 Closes #9387
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 0473a8af0..98773ebf2 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2131,9 +2131,11 @@ static CURLcode ftp_state_mdtm_resp(struct Curl_easy *data,
default:
infof(data, "unsupported MDTM reply format");
break;
- case 550: /* "No such file or directory" */
- failf(data, "Given file does not exist");
- result = CURLE_REMOTE_FILE_NOT_FOUND;
+ case 550: /* 550 is used for several different problems, e.g.
+ "No such file or directory" or "Permission denied".
+ It does not mean that the file does not exist at all. */
+ infof(data, "MDTM failed: file does not exist or permission problem,"
+ " continuing");
break;
}