summaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-11-10 10:08:32 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-11-10 10:08:32 +0000
commitf49276bfcbfa2e8e73bb01c7f7103126de1c1da2 (patch)
treefad2ef2f2f73dcbc09633bc8ba7cd8582c98aee0 /tests/ftpserver.pl
parentd08ee3c83d6bd416aef62ff844c98e47c4682429 (diff)
downloadcurl-f49276bfcbfa2e8e73bb01c7f7103126de1c1da2.tar.gz
ftpserver.pl: Fixed processing of IMAP authentication strings
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-xtests/ftpserver.pl19
1 files changed, 13 insertions, 6 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index b6ed5839a..410bbd4ec 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -3049,15 +3049,22 @@ while(1) {
my $FTPARG;
if($proto eq "imap") {
# IMAP is different with its identifier first on the command line
- unless(($full =~ /^([^ ]+) ([^ ]+) (.*)/) ||
- ($full =~ /^([^ ]+) ([^ ]+)/)) {
+ if(($full =~ /^([^ ]+) ([^ ]+) (.*)/) ||
+ ($full =~ /^([^ ]+) ([^ ]+)/)) {
+ $cmdid=$1; # set the global variable
+ $FTPCMD=$2;
+ $FTPARG=$3;
+ }
+ # IMAP long "commands" are base64 authentication data
+ elsif($full =~ /^[A-Z0-9+\/]*={0,2}$/i) {
+ # Command id has already been set
+ $FTPCMD=$full;
+ $FTPARG="";
+ }
+ else {
sendcontrol "$1 '$full': command not understood.\r\n";
last;
}
-
- $cmdid=$1; # set the global variable
- $FTPCMD=$2;
- $FTPARG=$3;
}
elsif($full =~ /^([A-Z]{3,4})(\s(.*))?$/i) {
$FTPCMD=$1;