From: Steve Holme Date: Thu, 29 Aug 2013 06:20:03 +0000 (+0100) Subject: ftpserver.pl: Added SELECT check to IMAP FETCH and STORE handlers X-Git-Tag: curl-7_33_0~198 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a353049ac94751d53e877c6b5f3c452d717cfe3;p=thirdparty%2Fcurl.git ftpserver.pl: Added SELECT check to IMAP FETCH and STORE handlers --- diff --git a/tests/ftpserver.pl b/tests/ftpserver.pl index ec7ccbba8a..2655575b83 100755 --- a/tests/ftpserver.pl +++ b/tests/ftpserver.pl @@ -829,6 +829,9 @@ sub FETCH_imap { $data[0] = $response; logmsg "return proof we are we\n"; } + elsif ($selected eq "") { + sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; + } else { logmsg "retrieve a mail\n"; @@ -941,8 +944,13 @@ sub STORE_imap { logmsg "STORE_imap got $args\n"; - sendcontrol "* $uid FETCH (FLAGS (\\Seen \\Deleted))\r\n"; - sendcontrol "$cmdid OK STORE completed\r\n"; + if ($selected eq "") { + sendcontrol "$cmdid BAD Command received in Invalid state\r\n"; + } + else { + sendcontrol "* $uid FETCH (FLAGS (\\Seen \\Deleted))\r\n"; + sendcontrol "$cmdid OK STORE completed\r\n"; + } return 0; }