]> granicus.if.org Git - curl/commitdiff
pop3: Fixed the issue of having to supply the user name for all requests
authorSteve Holme <steve_holme@hotmail.com>
Sat, 2 Jun 2012 21:11:37 +0000 (22:11 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 2 Jun 2012 21:11:37 +0000 (22:11 +0100)
Previously it wasn't possible to connect to POP3 and not specify the
user name as a CURLE_ACCESS_DENIED error would be returned. This error
occurred because USER would be sent to the server with a blank user name
if no mailbox user was specified as the server would reply with -ERR.

This wasn't a problem prior to the 7.26.0 release but with the
introduction of custom commands the user and/or application developer
might want to issue a CAPA command without having to log in as a
specific mailbox user.

Additionally this fix won't send the newly introduced AUTH command if no
user name is specified.

RELEASE-NOTES
lib/pop3.c

index 3352e8f8b3ca58a303c4066a726d86223b985887..115d6a3f184c866827b6a5f9d8d9cb97f0a8d314 100644 (file)
@@ -14,6 +14,7 @@ This release includes the following changes:
 
 This release includes the following bugfixes:
 
+ o pop3: Fixed the issue of having to supply the user name for all requests
  o 
 
 This release includes the following known bugs:
index 579e77bb5c597d5d97226c91d9e4da1b2dafd7ac..64efb255f15cc829a95e75317b0da59f2374ea51 100644 (file)
@@ -305,12 +305,20 @@ static void state(struct connectdata *conn, pop3state newstate)
 
 static CURLcode pop3_state_auth(struct connectdata *conn)
 {
-  CURLcode result;
+  CURLcode result = CURLE_OK;
   struct pop3_conn *pop3c = &conn->proto.pop3c;
 
   pop3c->authmechs = 0;         /* No known authentication mechanisms yet */
   pop3c->authused = 0;          /* Clear the authentication mechanism used */
 
+  /* Check we have a username and password to authenticate with and end the
+     connect phase if we don't */
+  if(!conn->bits.user_passwd) {
+    state(conn, SMTP_STOP);
+
+    return result;
+  }
+
   /* send AUTH */
   result = Curl_pp_sendf(&pop3c->pp, "AUTH");