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

@ -245,4 +245,4 @@ test2200 test2201 test2202 test2203 test2204 test2205 \
test3000 test3001 test3002 test3003 test3004 test3005 test3006 test3007 \
test3008 test3009 test3010 test3011 test3012 test3013 test3014 test3015 \
test3016 test3017 test3018 test3019 test3020 test3021 test3022 test3023 \
test3024 test3025 test3026
test3024 test3025 test3026 test3027

55
tests/data/test3027 Normal file
View file

@ -0,0 +1,55 @@
<testcase>
<info>
<keywords>
FTP
CURLOPT_FILETIME
MDTM fail
</keywords>
</info>
# Server-side
<reply>
<servercmd>
REPLY MDTM 550 Permission denied
</servercmd>
<data>
data blobb
</data>
# data is sent to stdout
</reply>
# Client-side
<client>
<server>
ftp
</server>
<name>
Get a file via FTP but 550 after MDTM command
</name>
<tool>
lib3027
</tool>
<command option="no-include">
ftp://%HOSTIP:%FTPPORT/%TESTNUMBER
</command>
<stdout>
data blobb
</stdout>
</client>
# Verify data after the test has been "shot"
<verify>
<protocol>
USER anonymous
PASS ftp@example.com
PWD
MDTM %TESTNUMBER
EPSV
TYPE I
SIZE %TESTNUMBER
RETR %TESTNUMBER
QUIT
</protocol>
</verify>
</testcase>

View file

@ -44,6 +44,8 @@ USER anonymous
PASS ftp@example.com
PWD
MDTM %TESTNUMBER
TYPE I
SIZE %TESTNUMBER
QUIT
</protocol>
</verify>