This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU gsasl".

http://git.savannah.gnu.org/cgit/gsasl.git/commit/?id=e785ef9b6382f8c7c52d7f49a308642d526a0527

The branch, gsasl_1_6_x has been updated
       via  e785ef9b6382f8c7c52d7f49a308642d526a0527 (commit)
      from  e09f7c3b0491d7377cd9496212f0b94ff935ee95 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e785ef9b6382f8c7c52d7f49a308642d526a0527
Author: Enrico Scholz <[email protected]>
Date:   Sat Nov 12 23:35:17 2011 +0100

    ignore untagged responses during IMAP authentication
    
    Some IMAP server (e.g. dovecot) return new capabilities as untagged
    response.  Old code expected only one line (e.g. the final '. OK')
    which would be given out as part of the application data.  E.g. without
    this patch, authentication to a dovecot server would look like:
    
    | $ gsasl mailbox 143 --imap ...
    | ...
    | + BQQF/wAMAAAAAAAAIO4EoAH...
    | BQQE/wAMAAAAAAAAII9BbgH...
    | * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ...
    | Client authentication finished (server trusted)...
    | Enter application data (EOF to finish):
    | . OK Logged in
    
    Patches changes it to
    
    | + BQQF/wAMAAAAAAAAIX...
    | BQQE/wAMAAAAAAAAK2...
    | * CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ...
    | . OK Logged in
    | Client authentication finished (server trusted)...
    | Enter application data (EOF to finish):
    
    Dialog with cyrus-imapd is not changed and ends always with
    
    | + BQQF/wAMAAAAAAAAPqx...
    | BQQE/wAMAAAAAAAAL...
    | . OK [CAPABILITY IMAP4 IMAP4rev1 LITERAL+ ...] Success (tls protection)
    | Client authentication finished (server trusted)...
    | Enter application data (EOF to finish):
    
    Signed-off-by: Enrico Scholz <[email protected]>
    Signed-off-by: Simon Josefsson <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 src/imap.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/imap.c b/src/imap.c
index 6affa41..43509ba 100644
--- a/src/imap.c
+++ b/src/imap.c
@@ -173,8 +173,17 @@ imap_auth_finish (void)
 {
   char *in;
 
-  if (!readln (&in))
-    return 0;
+  for (;;)
+    {
+      if (!readln (&in))
+       return 0;
+
+      /* skip untagged responses which can be returned by the server after
+        authentication (e.g. dovecot returns new '* CAPABILITY' information
+        before the final '. OK'). */
+      if (in[0] != '*')
+       break;
+    }
 
   return 1;
 }


hooks/post-receive
-- 
GNU gsasl

_______________________________________________
Gsasl-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gsasl-commit

Reply via email to