aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-10-24 22:54:53 +0200
committerDaniel Stenberg <daniel@haxx.se>2011-10-24 23:07:53 +0200
commitf4405d30e08a1ff684e101140915d8e08efbc426 (patch)
tree98f07a10757fe94a9a2ed8a3805be47c12dc7089
parente8d8843a02c104ae62b5c90b916d2a91d9b30335 (diff)
FTP server: allow EPRT by default
EPRT is now supported by default by the server. To disable it, use the generic REPLY instruction in the <servercmd> tag. Test 116 now has it disabled. All other existing active FTP port tests strip out the port commands from the logs already so the change of the server isn't that noticable.
-rw-r--r--tests/data/test1162
-rwxr-xr-xtests/ftpserver.pl12
2 files changed, 8 insertions, 6 deletions
diff --git a/tests/data/test116 b/tests/data/test116
index bf04492f1..9a36f9770 100644
--- a/tests/data/test116
+++ b/tests/data/test116
@@ -4,11 +4,13 @@
FTP
PORT
FAILURE
+EPRT refused
</keywords>
</info>
# Server-side
<reply>
<servercmd>
+REPLY EPRT 500 we don't like EPRT now
REPLY PORT 314 bluah you f00l!
</servercmd>
</reply>
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 43bdbae0c..55c1c50da 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -76,7 +76,6 @@ my $ipvnum = 4; # server IPv number (4 or 6)
my $proto = 'ftp'; # default server protocol
my $srcdir; # directory where ftpserver.pl is located
my $srvrname; # server name for presentation purposes
-my $grok_eprt;
my $path = '.';
my $logdir = $path .'/log';
@@ -1154,7 +1153,9 @@ sub PASV_ftp {
return;
}
-# Support both PORT and EPRT here. Consider LPRT too.
+#
+# Support both PORT and EPRT here.
+#
sub PORT_ftp {
my ($arg, $cmd) = @_;
@@ -1173,8 +1174,9 @@ sub PORT_ftp {
$addr = "$1.$2.$3.$4";
}
# EPRT |2|::1|49706|
- elsif(($cmd eq "EPRT") && ($grok_eprt)) {
+ elsif($cmd eq "EPRT") {
if($arg !~ /(\d+)\|([^\|]+)\|(\d+)/) {
+ logmsg "bad EPRT-line: $arg\n";
sendcontrol "500 silly you, go away\r\n";
return 0;
}
@@ -1242,7 +1244,7 @@ sub customize {
$customreply{$1}=eval "qq{$2}";
logmsg "FTPD: set custom reply for $1\n";
}
- if($_ =~ /COUNT ([A-Z]+) (.*)/) {
+ elsif($_ =~ /COUNT ([A-Z]+) (.*)/) {
# we blank the customreply for this command when having
# been used this number of times
$customcount{$1}=$2;
@@ -1341,12 +1343,10 @@ while(@ARGV) {
elsif($ARGV[0] eq '--ipv4') {
$ipvnum = 4;
$listenaddr = '127.0.0.1' if($listenaddr eq '::1');
- $grok_eprt = 0;
}
elsif($ARGV[0] eq '--ipv6') {
$ipvnum = 6;
$listenaddr = '::1' if($listenaddr eq '127.0.0.1');
- $grok_eprt = 1;
}
elsif($ARGV[0] eq '--port') {
if($ARGV[1] && ($ARGV[1] =~ /^(\d+)$/)) {