ftpserver.pl: Corrected invalid user details check
authorSteve Holme <steve_holme@hotmail.com>
Sat, 14 Sep 2013 23:31:55 +0000 (00:31 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 14 Sep 2013 23:31:55 +0000 (00:31 +0100)
...in both the IMAP LOGIN and POP3 PASS handlers introduced in commit
187ac693744949 and 84ad1569e5fc93 respectively.

tests/ftpserver.pl

index d26a76c..3fffcd7 100755 (executable)
@@ -833,7 +833,7 @@ sub LOGIN_imap {
     if ($user eq "") {
         sendcontrol "$cmdid BAD Command Argument\r\n";
     }
-    elsif (($user ne $TEXT_USERNAME) && ($password ne $TEXT_PASSWORD)) {
+    elsif (($user ne $TEXT_USERNAME) || ($password ne $TEXT_PASSWORD)) {
         sendcontrol "$cmdid NO LOGIN failed\r\n";
     }
     else {
@@ -1489,7 +1489,7 @@ sub PASS_pop3 {
 
     logmsg "PASS_pop3 got $password\n";
 
-    if (($username ne $TEXT_USERNAME) && ($password ne $TEXT_PASSWORD)) {
+    if (($username ne $TEXT_USERNAME) || ($password ne $TEXT_PASSWORD)) {
         sendcontrol "-ERR Login failure\r\n";
     }
     else {