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
This commit is contained in:
Michael Heimpold 2022-08-24 18:58:02 +02:00 committed by Daniel Stenberg
parent f703cf971c
commit d668685657
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 124 additions and 5 deletions

View file

@ -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;
}