ftpserver.pl: Corrected flawed logic in commit 1ca6ed7b75cad0

This commit is contained in:
Steve Holme 2013-08-31 11:10:20 +01:00
parent f3849a7b84
commit 5eea336d01

View File

@ -816,12 +816,17 @@ sub SELECT_imap {
sub FETCH_imap { sub FETCH_imap {
my ($args) = @_; my ($args) = @_;
my ($uid, $how) = split(/ /, $args, 2); my ($uid, $how) = split(/ /, $args, 2);
my @data;
my $size;
fix_imap_params($uid, $how); fix_imap_params($uid, $how);
logmsg "FETCH_imap got $args\n"; logmsg "FETCH_imap got $args\n";
if ($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
else {
my @data;
my $size;
if($selected eq "verifiedserver") { if($selected eq "verifiedserver") {
# this is the secret command that verifies that this actually is # this is the secret command that verifies that this actually is
# the curl test server # the curl test server
@ -832,9 +837,6 @@ sub FETCH_imap {
$data[0] = $response; $data[0] = $response;
logmsg "return proof we are we\n"; logmsg "return proof we are we\n";
} }
elsif ($selected eq "") {
sendcontrol "$cmdid BAD Command received in Invalid state\r\n";
}
else { else {
logmsg "retrieve a mail\n"; logmsg "retrieve a mail\n";
@ -864,6 +866,7 @@ sub FETCH_imap {
sendcontrol ")\r\n"; sendcontrol ")\r\n";
sendcontrol "$cmdid OK FETCH completed\r\n"; sendcontrol "$cmdid OK FETCH completed\r\n";
}
return 0; return 0;
} }
@ -973,7 +976,10 @@ sub LIST_imap {
logmsg "LIST_imap got $args\n"; logmsg "LIST_imap got $args\n";
if ($reference eq "verifiedserver") { if ($reference eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
elsif ($reference eq "verifiedserver") {
# this is the secret command that verifies that this actually is # this is the secret command that verifies that this actually is
# the curl test server # the curl test server
sendcontrol "* LIST () \"/\" \"WE ROOLZ: $$\"\r\n"; sendcontrol "* LIST () \"/\" \"WE ROOLZ: $$\"\r\n";
@ -985,9 +991,6 @@ sub LIST_imap {
logmsg "return proof we are we\n"; logmsg "return proof we are we\n";
} }
elsif ($reference eq "") {
sendcontrol "$cmdid BAD Command Argument\r\n";
}
else { else {
my $testno = $reference; my $testno = $reference;