]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: make the imap server not verify user+password
authorDaniel Stenberg <daniel@haxx.se>
Thu, 21 Sep 2017 06:21:43 +0000 (08:21 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 Sep 2017 12:43:33 +0000 (14:43 +0200)
... as the test cases themselves do that and it makes it easier to add
crazy test cases.

Test 800 updated to use user name + password that need quoting.

Test 856 updated to trigger an auth fail differently.

Ref: #1902

tests/data/test800
tests/data/test856
tests/ftpserver.pl

index 6b29f7a2badb3eb292221bb3f7ea75ae32053f9d..1ac1da59bb72ab7016b071ada4f062b9ac35581b 100644 (file)
@@ -31,7 +31,7 @@ imap
 IMAP FETCH message
  </name>
  <command>
-'imap://%HOSTIP:%IMAPPORT/800/;UID=1' -u user:secret
+'imap://%HOSTIP:%IMAPPORT/800/;UID=1' -u "user*:secret{"
 </command>
 </client>
 
@@ -40,7 +40,7 @@ IMAP FETCH message
 <verify>
 <protocol>
 A001 CAPABILITY\r
-A002 LOGIN user secret\r
+A002 LOGIN "user*" "secret{"\r
 A003 SELECT 800\r
 A004 FETCH 1 BODY[]\r
 A005 LOGOUT\r
index 4d8d7ed61ee96d6cf6f98ce80726e33219739242..dcb07c5a9174a2584b3381e23983ef04344f36bf 100644 (file)
@@ -10,6 +10,9 @@ FAILURE
 #
 # Server-side
 <reply>
+<servercmd>
+REPLY PASS -ERR Login failure
+</servercmd>
 </reply>
 
 #
index 081298f1b0cbf335ac2ecadbc0b24accef03f9ff..2aba4263a28d23dd1800095e1aacfc23e7495085 100755 (executable)
@@ -6,7 +6,7 @@
 #                            | (__| |_| |  _ <| |___
 #                             \___|\___/|_| \_\_____|
 #
-# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2014, 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
 #
 # This software is licensed as described in the file COPYING, which
 # you should have received as part of this distribution. The terms
@@ -174,7 +174,6 @@ my $exit_signal;         # first signal handled in exit_signal_handler
 #**********************************************************************
 # Mail related definitions
 #
-my $TEXT_USERNAME = "user";
 my $TEXT_PASSWORD = "secret";
 my $POP3_TIMESTAMP = "<1972.987654321\@curl>";
 
@@ -1121,9 +1120,6 @@ sub LOGIN_imap {
     if ($user eq "") {
         sendcontrol "$cmdid BAD Command Argument\r\n";
     }
-    elsif (($user ne $TEXT_USERNAME) || ($password ne $TEXT_PASSWORD)) {
-        sendcontrol "$cmdid NO LOGIN failed\r\n";
-    }
     else {
         sendcontrol "$cmdid OK LOGIN completed\r\n";
     }
@@ -1681,7 +1677,7 @@ sub APOP_pop3 {
     else {
         my $digest = Digest::MD5::md5_hex($POP3_TIMESTAMP, $TEXT_PASSWORD);
 
-        if (($user ne $TEXT_USERNAME) || ($secret ne $digest)) {
+        if ($secret ne $digest) {
             sendcontrol "-ERR Login failure\r\n";
         }
         else {
@@ -1740,12 +1736,7 @@ sub PASS_pop3 {
 
     logmsg "PASS_pop3 got $password\n";
 
-    if (($username ne $TEXT_USERNAME) || ($password ne $TEXT_PASSWORD)) {
-        sendcontrol "-ERR Login failure\r\n";
-    }
-    else {
-        sendcontrol "+OK Login successful\r\n";
-    }
+    sendcontrol "+OK Login successful\r\n";
 
     return 0;
 }