]> granicus.if.org Git - curl/commitdiff
ftpserver.pl: Fixed processing of POP3 authentication strings
authorSteve Holme <steve_holme@hotmail.com>
Sat, 19 Oct 2013 19:39:18 +0000 (20:39 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 19 Oct 2013 19:39:18 +0000 (20:39 +0100)
...and corrected response when check fails from 500 to -ERR.

tests/ftpserver.pl

index d0986ea7733d072693b6c46b7cc8f1a13a63d75d..5c5d19a5341f7417f79e3edf72c145138bca7a51 100755 (executable)
@@ -3049,6 +3049,7 @@ while(1) {
                 sendcontrol "$1 '$full': command not understood.\r\n";
                 last;
             }
+
             $cmdid=$1; # set the global variable
             $FTPCMD=$2;
             $FTPARG=$3;
@@ -3057,6 +3058,16 @@ while(1) {
             $FTPCMD=$1;
             $FTPARG=$3;
         }
+        elsif($proto eq "pop3") {
+            # POP3 long "commands" are base64 authentication data
+            unless($full =~ /^[A-Z0-9+\/]+={0,2}$/i)) {
+                sendcontrol "-ERR '$full': command not understood.\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;