-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
6 changed files
with
122 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/*************************************************************************** | ||
* _ _ ____ _ | ||
* Project ___| | | | _ \| | | ||
* / __| | | | |_) | | | ||
* | (__| |_| | _ <| |___ | ||
* \___|\___/|_| \_\_____| | ||
* | ||
* Copyright (C) 2020 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al. | ||
* | ||
* This software is licensed as described in the file COPYING, which | ||
* you should have received as part of this distribution. The terms | ||
* are also available at https://curl.se/docs/copyright.html. | ||
* | ||
* You may opt to use, copy, modify, merge, publish, distribute and/or sell | ||
* copies of the Software, and permit persons to whom the Software is | ||
* furnished to do so, under the terms of the COPYING file. | ||
* | ||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
* KIND, either express or implied. | ||
* | ||
* SPDX-License-Identifier: curl | ||
* | ||
***************************************************************************/ | ||
#include "test.h" | ||
|
||
#include "testutil.h" | ||
#include "warnless.h" | ||
#include "memdebug.h" | ||
|
||
int test(char *URL) | ||
{ | ||
CURLcode ret = CURLE_OK; | ||
CURL *hnd; | ||
start_test_timing(); | ||
|
||
curl_global_init(CURL_GLOBAL_ALL); | ||
|
||
hnd = curl_easy_init(); | ||
if(hnd) { | ||
curl_easy_setopt(hnd, CURLOPT_URL, URL); | ||
curl_easy_setopt(hnd, CURLOPT_FILETIME, 1L); | ||
ret = curl_easy_perform(hnd); | ||
if(CURLE_OK == ret) { | ||
long filetime; | ||
ret = curl_easy_getinfo(hnd, CURLINFO_FILETIME, &filetime); | ||
/* MTDM fails with 550, so filetime should be -1 */ | ||
if((CURLE_OK == ret) && (filetime != -1)) { | ||
ret = 1; | ||
} | ||
} | ||
curl_easy_cleanup(hnd); | ||
} | ||
curl_global_cleanup(); | ||
return (int)ret; | ||
} |