From 4a4c7245998af59dbc16f267fd5f000f2950ba4f Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 25 Sep 2020 17:13:42 +0200 Subject: ftp: make a 552 response return CURLE_REMOTE_DISK_FULL Added test 348 to verify. Added a 'STOR' command to the test FTP server to enable test 348. Documented the command in FILEFORMAT.md Reported-by: Duncan Wilcox Fixes #6016 Closes #6017 --- lib/ftp.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ftp.c b/lib/ftp.c index 3fd9cea2c..11031da6f 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3292,9 +3292,18 @@ static CURLcode ftp_done(struct connectdata *conn, CURLcode status, if(!ftpc->dont_check) { /* 226 Transfer complete, 250 Requested file action okay, completed. */ - if((ftpcode != 226) && (ftpcode != 250)) { + switch(ftpcode) { + case 226: + case 250: + break; + case 552: + failf(data, "Exceeded storage allocation"); + result = CURLE_REMOTE_DISK_FULL; + break; + default: failf(data, "server did not report OK, got %d", ftpcode); result = CURLE_PARTIAL_FILE; + break; } } } -- cgit v1.2.1