From 615edc1f73090f5f876f1491f9658f6429fdf481 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 1 Dec 2017 00:45:46 +0100 Subject: sasl_getmesssage: make sure we have a long enough string to pass For pop3/imap/smtp, added test 891 to somewhat verify the pop3 case. For this, I enhanced the pingpong test server to be able to send back responses with LF-only instead of always using CRLF. Closes #2150 --- tests/ftpserver.pl | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tests/ftpserver.pl') diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index ae8b4a017..956275881 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -2755,13 +2755,19 @@ sub customize { $fulltextreply{$1}=eval "qq{$2}"; logmsg "FTPD: set custom reply for $1\n"; } - elsif($_ =~ /REPLY ([A-Za-z0-9+\/=\*]*) (.*)/) { - $commandreply{$1}=eval "qq{$2}"; - if($1 eq "") { + elsif($_ =~ /REPLY(LF|) ([A-Za-z0-9+\/=\*]*) (.*)/) { + $commandreply{$2}=eval "qq{$3}"; + if($1 ne "LF") { + $commandreply{$2}.="\r\n"; + } + else { + $commandreply{$2}.="\n"; + } + if($2 eq "") { logmsg "FTPD: set custom reply for empty command\n"; } else { - logmsg "FTPD: set custom reply for $1 command\n"; + logmsg "FTPD: set custom reply for $2 command\n"; } } elsif($_ =~ /COUNT ([A-Z]+) (.*)/) { @@ -3175,7 +3181,7 @@ while(1) { $commandreply{$FTPCMD}=""; } - sendcontrol "$text\r\n"; + sendcontrol $text; $check = 0; } else { -- cgit v1.2.3