ftpserver.pl: fix newlines in 227/229 replies, adjust tests

The test FTP server returned LF newlines for 227/229 replies, instead of
the CRLF used for the rest.

Test data added later were explicitly made to expect an LF in these
response lines.

After this patch the FTP server returns CRLF newlines, allowing
to delete this special case in test data.

Follow-up to 3bfff57e1f
Follow-up to a7937ed49c

Closes #19330
This commit is contained in:
Viktor Szakats
2025-11-02 23:25:27 +01:00
parent aaf9522a2c
commit 254e04b702
25 changed files with 26 additions and 26 deletions

View File

@@ -58,7 +58,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -58,7 +58,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -59,7 +59,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -59,7 +59,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -58,7 +58,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -56,7 +56,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -71,7 +71,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for %TESTNUMBER () (214 bytes).

View File

@@ -71,7 +71,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for %TESTNUMBER () (214 bytes).

View File

@@ -72,7 +72,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for %TESTNUMBER () (214 bytes).

View File

@@ -72,7 +72,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for %TESTNUMBER () (214 bytes).

View File

@@ -71,7 +71,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for %TESTNUMBER () (214 bytes).

View File

@@ -71,7 +71,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 214
150 Binary data connection for %TESTNUMBER () (214 bytes).

View File

@@ -56,7 +56,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -56,7 +56,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -57,7 +57,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -57,7 +57,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -56,7 +56,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -56,7 +56,7 @@ mooo
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 10
150 Binary data connection for %TESTNUMBER () (10 bytes).

View File

@@ -71,7 +71,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 222
150 Binary data connection for %TESTNUMBER () (222 bytes).

View File

@@ -71,7 +71,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 222
150 Binary data connection for %TESTNUMBER () (222 bytes).

View File

@@ -72,7 +72,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 222
150 Binary data connection for %TESTNUMBER () (222 bytes).

View File

@@ -72,7 +72,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 222
150 Binary data connection for %TESTNUMBER () (222 bytes).

View File

@@ -71,7 +71,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 222
150 Binary data connection for %TESTNUMBER () (222 bytes).

View File

@@ -71,7 +71,7 @@ MOOOO
230 Welcome you silly person
257 "/" is current directory
250 CWD command successful.
229 Entering Passive Mode (stripped)
229 Entering Passive Mode (stripped)
200 I modify TYPE as you wanted
213 222
150 Binary data connection for %TESTNUMBER () (222 bytes).

View File

@@ -2566,12 +2566,12 @@ sub PASV_ftp {
if($pasvbadip) {
$p="1,2,3,4";
}
sendcontrol sprintf("227 Entering Passive Mode ($p,%d,%d)\n",
sendcontrol sprintf("227 Entering Passive Mode ($p,%d,%d)\r\n",
int($pasvport/256), int($pasvport%256));
}
else {
# EPSV reply
sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\n", $pasvport);
sendcontrol sprintf("229 Entering Passive Mode (|||%d|)\r\n", $pasvport);
}
logmsg "Client has been notified that DATA conn ".