summaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-11-23 22:14:34 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-11-23 22:14:34 +0000
commit23fabf8dea65157f02b4663fad102424776805a9 (patch)
treec24292d270a57822b25c6a14fd35f963540c6085 /tests/ftpserver.pl
parent7a36b2abc068625b821d01cbf14c545cacc95c65 (diff)
downloadcurl-23fabf8dea65157f02b4663fad102424776805a9.tar.gz
ftpserver.pl: Reworked fix from commit 7a36b2abc06862
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-xtests/ftpserver.pl42
1 files changed, 32 insertions, 10 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index 38f0f3d3a..5c62c241b 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -3167,9 +3167,14 @@ while(1) {
$FTPCMD=$2;
$FTPARG=$3;
}
+ # IMAP authentication cancellation
+ elsif($full =~ /^\*$/) {
+ # Command id has already been set
+ $FTPCMD="*";
+ $FTPARG="";
+ }
# IMAP long "commands" are base64 authentication data
- elsif(($full =~ /^[A-Z0-9+\/]*={0,2}$/i) ||
- ($full == "*")) {
+ elsif($full =~ /^[A-Z0-9+\/]*={0,2}$/i) {
# Command id has already been set
$FTPCMD=$full;
$FTPARG="";
@@ -3184,19 +3189,36 @@ while(1) {
$FTPARG=$3;
}
elsif($proto eq "pop3") {
+ # POP3 authentication cancellation
+ if($full =~ /^\*$/) {
+ $FTPCMD="*";
+ $FTPARG="";
+ }
# POP3 long "commands" are base64 authentication data
- unless($full =~ /^[A-Z0-9+\/]*={0,2}$/i) {
+ elsif($full =~ /^[A-Z0-9+\/]*={0,2}$/i) {
+ $FTPCMD=$full;
+ $FTPARG="";
+ }
+ else {
sendcontrol "-ERR Unrecognized command\r\n";
last;
}
-
- $FTPCMD=$full;
- $FTPARG="";
}
- elsif(($proto eq "smtp") && ($full =~ /^[A-Z0-9+\/]{0,512}={0,2}$/i)) {
- # SMTP long "commands" are base64 authentication data.
- $FTPCMD=$full;
- $FTPARG="";
+ elsif($proto eq "smtp") {
+ # SMTP authentication cancellation
+ if($full =~ /^\*$/) {
+ $FTPCMD="*";
+ $FTPARG="";
+ }
+ # SMTP long "commands" are base64 authentication data
+ elsif($full =~ /^[A-Z0-9+\/]{0,512}={0,2}$/i) {
+ $FTPCMD=$full;
+ $FTPARG="";
+ }
+ else {
+ sendcontrol "500 Unrecognized command\r\n";
+ last;
+ }
}
else {
sendcontrol "500 Unrecognized command\r\n";