Simon Josefsson <[email protected]> ha escrit: > Works fine here, please push!
Pushed, as well as the cumulative patch below. Regards, Sergey >From 019d0e4703c1176a318717cebe95dd8241a2d3cd Mon Sep 17 00:00:00 2001 From: Simon Josefsson <[email protected]> Date: Thu, 24 Sep 2009 20:55:58 +0300 Subject: [PATCH] SASL related fixes. * imap4d/auth_gsasl.c (auth_gsasl): Make IMAP server wait for empty final client response. * include/mailutils/gsasl.h (mu_gsasl_stream_create): Don't use deprecated GNU SASL types. --- imap4d/auth_gsasl.c | 15 ++++++++++++--- include/mailutils/gsasl.h | 3 +-- libmu_auth/gsasl.c | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/imap4d/auth_gsasl.c b/imap4d/auth_gsasl.c index f170f81..3ea71ed 100644 --- a/imap4d/auth_gsasl.c +++ b/imap4d/auth_gsasl.c @@ -109,10 +109,19 @@ auth_gsasl (struct imap4d_command *command, char *auth_type, char **username) return RESP_NO; } - /* Some SASL mechanisms output data when GSASL_OK is returned */ + /* Some SASL mechanisms output additional data when GSASL_OK is + returned, and clients must respond with an empty response. */ if (output[0]) - util_send ("+ %s\r\n", output); - + { + util_send ("+ %s\r\n", output); + imap4d_getline (&input_str, &input_size, &input_len); + if (input_len != 0) + { + mu_diag_output (MU_DIAG_NOTICE, _("non-empty client response")); + return RESP_NO; + } + } + free (output); if (*username == NULL) diff --git a/include/mailutils/gsasl.h b/include/mailutils/gsasl.h index 6067746..ef33f25 100644 --- a/include/mailutils/gsasl.h +++ b/include/mailutils/gsasl.h @@ -37,8 +37,7 @@ struct mu_gsasl_module_data mu_gsasl_module_data; #include <gsasl.h> int mu_gsasl_stream_create (mu_stream_t *stream, mu_stream_t transport, - Gsasl_session_ctx *ctx, - int flags); + Gsasl_session *ctx, int flags); #endif -- 1.6.0 _______________________________________________ Bug-mailutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-mailutils
