summaryrefslogtreecommitdiff
path: root/tests/ftpserver.pl
diff options
context:
space:
mode:
authormonnerat <pm@datasphere.ch>2010-04-19 11:16:30 +0200
committermonnerat <pm@datasphere.ch>2010-04-19 11:16:30 +0200
commit4bfe07640c93f8dfd3af4bb76c8346ef4a129cc8 (patch)
treead0163b0560ab8fb593b7f98a6c53822a57d08a4 /tests/ftpserver.pl
parentc5e539c312af011e312bd82a9fef6c2c44061ca9 (diff)
downloadcurl-4bfe07640c93f8dfd3af4bb76c8346ef4a129cc8.tar.gz
Implement SMTP authentication
Diffstat (limited to 'tests/ftpserver.pl')
-rwxr-xr-xtests/ftpserver.pl19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl
index d6b676cab..cc69585c8 100755
--- a/tests/ftpserver.pl
+++ b/tests/ftpserver.pl
@@ -1118,7 +1118,7 @@ sub customize {
logmsg "FTPD: Getting commands from log/ftpserver.cmd\n";
while(<CUSTOM>) {
- if($_ =~ /REPLY ([A-Z]+) (.*)/) {
+ if($_ =~ /REPLY ([A-Za-z0-9+\/=]+) (.*)/) {
$customreply{$1}=eval "qq{$2}";
logmsg "FTPD: set custom reply for $1\n";
}
@@ -1380,13 +1380,18 @@ while(1) {
$FTPCMD=$2;
$FTPARG=$3;
}
- else {
- unless (m/^([A-Z]{3,4})\s?(.*)/i) {
- sendcontrol "500 '$_': command not understood.\r\n";
- last;
- }
+ elsif (m/^([A-Z]{3,4})(\s(.*))?$/i) {
$FTPCMD=$1;
- $FTPARG=$2;
+ $FTPARG=$3;
+ }
+ elsif($proto eq "smtp" && m/^[A-Z0-9+\/]{0,512}={0,2}$/i) {
+ # SMTP long "commands" are base64 authentication data.
+ $FTPCMD=$_;
+ $FTPARG="";
+ }
+ else {
+ sendcontrol "500 '$_': command not understood.\r\n";
+ last;
}
logmsg "< \"$full\"\n";